Class Directory
java.lang.Object
org.apache.tools.ant.taskdefs.optional.ssh.Directory
A helper object for Scp representing a directory in a file system.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddDirectory(Directory directory) Add a directory to the child directories.voidAdd a file to the list of files.Get an iterator over the child Directories.booleanThe equality method.Get an iterator over the files.intfileSize()Get the number of files in the files attribute.Get a child directory of this directory.Get the directory file.Get the parent Directory.String[]getPath()Get the path components of this directory.static String[]Convert a file path to an array of path components.inthashCode()The hashcode method.booleanisRoot()Is this a root Directory?
- 
Constructor Details- 
DirectoryConstructor for a Directory.- Parameters:
- directory- a directory.
 
- 
DirectoryConstructor for a Directory.- Parameters:
- directory- a directory
- parent- a parent Directory
 
 
- 
- 
Method Details- 
addDirectoryAdd a directory to the child directories.- Parameters:
- directory- a Directory
 
- 
addFileAdd a file to the list of files.- Parameters:
- file- a file to add
 
- 
directoryIteratorGet an iterator over the child Directories.- Returns:
- an iterator
 
- 
filesIteratorGet an iterator over the files.- Returns:
- an iterator
 
- 
getParentGet the parent Directory.- Returns:
- the parent Directory.
 
- 
isRootpublic boolean isRoot()Is this a root Directory?- Returns:
- true if there is no parent Directory
 
- 
getDirectoryGet the directory file.- Returns:
- the directory file
 
- 
getChildGet a child directory of this directory.- Parameters:
- dir- the directory to look for
- Returns:
- the child directory, or null if not found
 
- 
equalsThe equality method. This checks if the directory field is the same.
- 
hashCodepublic int hashCode()The hashcode method.
- 
getPathGet the path components of this directory.- Returns:
- the path components as an array of strings.
 
- 
getPathConvert a file path to an array of path components. This uses File.separator to split the file path string.- Parameters:
- thePath- the file path string to convert
- Returns:
- an array of path components
 
- 
fileSizepublic int fileSize()Get the number of files in the files attribute.- Returns:
- the number of files
 
 
-