kiwi.util
Class DirectoryPath
java.lang.Object
|
+--kiwi.util.DirectoryPath
- public class DirectoryPath
- extends java.lang.Object
A convenience class for maintaining a directory path (that is, an ordered
list of directories).
- Author:
- Mark Lindner, PING Software Group
Field Summary |
private java.util.Vector |
_dirs
|
private java.lang.String |
psep
|
Constructor Summary |
DirectoryPath()
Construct a new, empty DirectoryPath . |
DirectoryPath(java.lang.String[] dirs)
Construct a new DirectoryPath for the given directories. |
Method Summary |
void |
append(java.lang.String dir)
Append a directory to the end of the path. |
void |
append(java.lang.String[] dirs)
Append a list directories to the end of the path. |
java.lang.String[] |
getDirectories()
Get the list of directories for this path. |
void |
prepend(java.lang.String dir)
Prepend a directory to the beginning of the path. |
void |
prepend(java.lang.String[] dirs)
Prepend a list directories to the beginning of the path. |
java.lang.String |
toString()
Convert this path to a string, using the appropriate path separator for
this platform. |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait |
psep
private java.lang.String psep
_dirs
private java.util.Vector _dirs
DirectoryPath
public DirectoryPath()
- Construct a new, empty
DirectoryPath
.
DirectoryPath
public DirectoryPath(java.lang.String[] dirs)
- Construct a new
DirectoryPath
for the given directories.
- Parameters:
dirs
- An array of directory names.
prepend
public void prepend(java.lang.String dir)
- Prepend a directory to the beginning of the path.
- Parameters:
dir
- The directory to add.
prepend
public void prepend(java.lang.String[] dirs)
- Prepend a list directories to the beginning of the path. The order of
the directories is preserved.
- Parameters:
dirs
- The directories to add.
append
public void append(java.lang.String dir)
- Append a directory to the end of the path.
- Parameters:
dir
- The directory to add.
append
public void append(java.lang.String[] dirs)
- Append a list directories to the end of the path. The order of the
directories is preserved.
- Parameters:
dirs
- The directories to add.
getDirectories
public java.lang.String[] getDirectories()
- Get the list of directories for this path.
- Returns:
- An array of directory names.
toString
public java.lang.String toString()
- Convert this path to a string, using the appropriate path separator for
this platform.
- Overrides:
toString
in class java.lang.Object