mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

smaguin
20.34.2007 f3efeee96260f0d19e081cfced6c7e6efc540250
add function to list folder
1 files modified
57 ■■■■■ changed files
opends/tests/functional-tests/shared/functions/stafcmd.xml 57 ●●●●● patch | view | raw | blame | history
opends/tests/functional-tests/shared/functions/stafcmd.xml
@@ -617,4 +617,61 @@
  </function>
        
<!-- List a folder -->
  <function name="listFolder">
    <function-prolog>
        This function  lists a folder
    </function-prolog>
    <function-map-args>
      <function-arg-def name="location" type="optional" default="STAXServiceMachine">
        <function-arg-description>
          Location of target host
        </function-arg-description>
        <function-arg-property name="type" value="hostname"/>
      </function-arg-def>
      <function-arg-def name="foldername" type="required">
        <function-arg-description>
          Name of folder to be list
        </function-arg-description>
        <function-arg-property name="type" value="filepath"/>
      </function-arg-def>
      <function-arg-def name="filename" type="required">
        <function-arg-description>
          Name of file to be list
        </function-arg-description>
        <function-arg-property name="type" value="filepath"/>
      </function-arg-def>
    </function-map-args>
    <sequence>
      <stafcmd name="'STAF Command: list Folder Attributes'">
        <location>'%s' % location</location>
        <service>'fs'</service>
        <request>' LIST DIRECTORY %s NAME %s LONG ' % (foldername,filename)</request>
      </stafcmd>
      <if expr="RC != 0">
        <sequence>
          <message log="1">
            'Folder does not exist.'
          </message>
          <return>0</return>
        </sequence>
      </if>
      <script>
        cmdRC=RC
        cmdResult=STAFResult
      </script>
      <call function="'checkRC'">
          { 'returncode' : cmdRC ,
            'result'     : cmdResult }
      </call>
      <return>cmdRC</return>
      </sequence>
    </function>
</stax>