Informs if the referenced file by the FTPFile object returned by <ftp.listFiles> is a directory.
1 ftp.file.isDirectory
<ftp.file.isDirectory>
<ftpfile /> +
</ftp.file.isDirectory>
Arguments | |||||
---|---|---|---|---|---|
Name | Type | Required | Unique | Nullable | Description |
Eftpfile | FtpFile | An Ftp file. |
Returns | |
---|---|
Type | Description |
Boolean | Returns true if it is a directory and false if it is a normal file. |
Example
List the files of the FTP server which accomplish a condition and shows an alertif any of them is a folder.
Copy
<xsql-script name='ftp_sample1'> <body> <ftp host='192.168.10.1' user='ftpuser' password='ftppasswd'> <set name='m_list'><ftp.listFiles pattern='*2012*' /></set> <iterator name='m_fileobj' index='i'> <in><m_list/></in> <do> <println><ftp.file.getName><m_fileobj/><ftp.file.getName/> <if> <expr><ftp.file.isDirectory><m_fileobj/></ftp.file.isDirectory></expr> <then> <println>It is a directory</println> </then> </if> </do> </iterator> </ftp> </body> </xsql-script>