org.apache.tools.ant.taskdefs.optional.net

Class FTP.FTPDirectoryScanner

  • All Implemented Interfaces:
    FileScanner, ResourceFactory, SelectorScanner
    Enclosing class:
    FTP


    protected class FTP.FTPDirectoryScanner
    extends DirectoryScanner
    internal class allowing to read the contents of a remote file system using the FTP protocol used in particular for ftp get operations differences with DirectoryScanner "" (the root of the fileset) is never included in the included directories followSymlinks defaults to false
    • Field Detail

      • ftp

        protected org.apache.commons.net.ftp.FTPClient ftp
    • Constructor Detail

      • FTPDirectoryScanner

        public FTPDirectoryScanner(org.apache.commons.net.ftp.FTPClient ftp)
        constructor
        Parameters:
        ftp - ftpclient object
    • Method Detail

      • scan

        public void scan()
        scans the remote directory, storing internally the included files, directories, ...
        Specified by:
        scan in interface FileScanner
        Overrides:
        scan in class DirectoryScanner
      • scandir

        protected void scandir(java.lang.String dir,
                               java.lang.String vpath,
                               boolean fast)
        scans a particular directory. populates the scannedDirs cache.
        Parameters:
        dir - directory to scan
        vpath - relative path to the base directory of the remote fileset always ended with a File.separator
        fast - seems to be always true in practice
      • listFiles

        public org.apache.commons.net.ftp.FTPFile[] listFiles(java.lang.String directory,
                                                              boolean changedir)
        list the files present in one directory.
        Parameters:
        directory - full path on the remote side
        changedir - if true change to directory directory before listing
        Returns:
        array of FTPFile
      • listFiles

        public org.apache.commons.net.ftp.FTPFile[] listFiles(java.lang.String directory)
        cd into one directory and list the files present in one directory.
        Parameters:
        directory - full path on the remote side
        Returns:
        array of FTPFile