Check if the specified file is a directory.
 

1 file.isDirectory

<file.isDirectory>
    <file /> !
</file.isDirectory>
Example

Check the existence of a directory.

Copy
<xsql-script name='file_isDirectory_sample1'>
    <body>
        <set name='m_path'>
            <string>c:<file.separator />tmp</string>
        </set>
        <if>
            <expr>
                <file.isDirectory>
                    <file name='#m_path' type='absolute' />
                </file.isDirectory>
            </expr>
            <then>
                <set name='m_result'>directory</set>
            </then>
            <else>
                <set name='m_result'>file</set>
            </else>
        </if>
        <println><m_path/> is a <m_result/></println>
    </body>
</xsql-script>

c:\tmp is a directory.

Example

Check the existence of a file.

Copy
<xsql-script name='file_isDirectory_sample2'>
   <body>
       <set name='m_path'>
           <string>c:<file.separator />tmp<file.separator />JASLicense.properties</string>
       </set>
       <if>
           <expr>
               <file.isDirectory>
                   <file name='#m_path' type='absolute' />
               </file.isDirectory>
           </expr>
           <then>
               <set name='m_result'>directory</set>
           </then>
           <else>
               <set name='m_result'>file</set>
           </else>
       </if>
       <println><m_path/> is a <m_result/></println>
   </body>

</xsql-script>

c:\tmp\JASLicense.properties is a file.