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

Class FTP.FTPDirectoryScanner

Enclosing Class:
FTP
Implemented Interfaces:
FileScanner, ResourceFactory, SelectorScanner

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

Nested Class Summary

protected class
FTP.FTPDirectoryScanner.AntFTPFile
an AntFTPFile is a representation of a remote file
protected class
FTP.FTPDirectoryScanner.AntFTPRootFile
special class to represent the remote directory itself

Field Summary

protected FTPClient
ftp

Fields inherited from class org.apache.tools.ant.DirectoryScanner

DEFAULTEXCLUDES, basedir, dirsDeselected, dirsExcluded, dirsIncluded, dirsNotIncluded, everythingIncluded, excludes, filesDeselected, filesExcluded, filesIncluded, filesNotIncluded, haveSlowResults, includes, isCaseSensitive, selectors

Constructor Summary

FTPDirectoryScanner(FTPClient ftp)
constructor

Method Summary

FTPFile[]
listFiles(String directory)
cd into one directory and list the files present in one directory.
FTPFile[]
listFiles(String directory, boolean changedir)
list the files present in one directory.
void
scan()
scans the remote directory, storing internally the included files, directories, ...
protected void
scandir(String dir, String vpath, boolean fast)
scans a particular directory

Methods inherited from class org.apache.tools.ant.DirectoryScanner

addDefaultExclude, addDefaultExcludes, addExcludes, clearResults, couldHoldIncluded, getBasedir, getDefaultExcludes, getDeselectedDirectories, getDeselectedFiles, getExcludedDirectories, getExcludedFiles, getIncludedDirectories, getIncludedDirsCount, getIncludedFiles, getIncludedFilesCount, getNotIncludedDirectories, getNotIncludedFiles, getResource, isCaseSensitive, isEverythingIncluded, isExcluded, isFollowSymlinks, isIncluded, isSelected, match, match, matchPath, matchPath, matchPatternStart, matchPatternStart, removeDefaultExclude, resetDefaultExcludes, scan, scandir, setBasedir, setBasedir, setCaseSensitive, setExcludes, setFollowSymlinks, setIncludes, setSelectors, slowScan

Field Details

ftp

protected FTPClient ftp

Constructor Details

FTPDirectoryScanner

public FTPDirectoryScanner(FTPClient ftp)
constructor
Parameters:
ftp - ftpclient object

Method Details

listFiles

public FTPFile[] listFiles(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

listFiles

public FTPFile[] listFiles(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

scan

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

scandir

protected void scandir(String dir,
                       String vpath,
                       boolean fast)
scans a particular directory
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

Copyright B) 2000-2007 Apache Software Foundation. All Rights Reserved.