Methods Summary |
---|
public void | addDirectory(org.apache.tools.ant.taskdefs.optional.ssh.Directory directory)Add a directory to the child directories.
if (!childDirectories.contains(directory)) {
childDirectories.add(directory);
}
|
public void | addFile(java.io.File file)Add a file to the list of files.
files.add(file);
|
public java.util.Iterator | directoryIterator()Get an iterator over the child Directories.
return childDirectories.iterator();
|
public boolean | equals(java.lang.Object obj)The equality method.
This checks if the directory field is the same.
if (obj == this) {
return true;
}
if (!(obj instanceof Directory)) {
return false;
}
Directory d = (Directory) obj;
return this.directory.equals(d.directory);
|
public int | fileSize()Get the number of files in the files attribute.
return files.size();
|
public java.util.Iterator | filesIterator()Get an iterator over the files.
return files.iterator();
|
public org.apache.tools.ant.taskdefs.optional.ssh.Directory | getChild(java.io.File dir)Get a child directory of this directory.
for (int i = 0; i < childDirectories.size(); i++) {
Directory current = (Directory) childDirectories.get(i);
if (current.getDirectory().equals(dir)) {
return current;
}
}
return null;
|
public java.io.File | getDirectory()Get the directory file.
return directory;
|
public org.apache.tools.ant.taskdefs.optional.ssh.Directory | getParent()Get the parent Directory.
return parent;
|
public java.lang.String[] | getPath()Get the path components of this directory.
return getPath(directory.getAbsolutePath());
|
public static java.lang.String[] | getPath(java.lang.String thePath)Convert a file path to an array of path components.
This uses File.sepatator to split the file path string.
StringTokenizer tokenizer = new StringTokenizer(thePath,
File.separator);
String[] path = new String[ tokenizer.countTokens() ];
int i = 0;
while (tokenizer.hasMoreTokens()) {
path[i] = tokenizer.nextToken();
i++;
}
return path;
|
public int | hashCode()The hashcode method.
return directory.hashCode();
|
public boolean | isRoot()Is this a root Directory?
return parent == null;
|