public class Path extends DataType implements Cloneable
<sometask>
<somepath>
<pathelement location="/path/to/file.jar" />
<pathelement path="/path/to/file2.jar:/path/to/class2;/path/to/class3" />
<pathelement location="/path/to/file3.jar" />
<pathelement location="/path/to/file4.jar" />
</somepath>
</sometask>
The object implemention sometask must provide a method called
createSomepath which returns an instance of Path.
Nested path definitions are handled by the Path object and must be labeled
pathelement.The path element takes a parameter
path which will be parsed
and split into single elements. It will usually be used
to define a path from an environment variable.| Modifier and Type | Class and Description |
|---|---|
class |
Path.PathElement
Helper class, holds the nested
<pathelement> values. |
| Constructor and Description |
|---|
Path()
Construct an empty Path.
|
Path(InstallData idata,
String path)
Invoked by IntrospectionHelper for
setXXX(Path p)
attribute setters. |
| Modifier and Type | Method and Description |
|---|---|
void |
add(Path path)
Adds a nested path
|
void |
addDirset(DirSet dset)
Adds a nested
<dirset> element. |
void |
addExisting(Path source)
Adds the components on the given path which exist to this
Path.
|
void |
addExisting(Path source,
boolean tryUserDir)
Same as addExisting, but support classpath behavior if tryUserDir
is true.
|
void |
addFilelist(FileList fl)
Adds a nested
<filelist> element. |
void |
addFileset(FileSet fs)
Adds a nested
<fileset> element. |
void |
append(Path other)
Append the contents of the other Path instance to this.
|
Object |
clone()
Return a Path that holds the same elements as this instance.
|
Path |
createPath()
Creates a nested
<path> element. |
Path.PathElement |
createPathElement()
Creates the nested
<pathelement> element. |
String[] |
list()
Returns all path elements defined by this and nested path objects.
|
void |
setLocation(File location)
Adds a element definition to the path.
|
void |
setPath(InstallData idata,
String path)
Parses a path definition and creates single PathElements.
|
int |
size()
How many parts does this Path instance consist of.
|
String |
toString()
Returns a textual representation of the path, which can be used as
CLASSPATH or PATH environment variable definition.
|
static String |
translateFile(String source)
Returns its argument with all file separator characters
replaced so that they match the local OS conventions.
|
protected static boolean |
translateFileSep(StringBuffer buffer,
int pos)
Translates all occurrences of / or \ to correct separator of the
current platform and returns whether it had to do any
replacements.
|
static String[] |
translatePath(InstallData idata,
String source)
Splits a PATH (with : or ; as separators) into its parts.
|
getDescription, isChecked, noChildrenAllowed, setChecked, setDescription, tooManyAttributespublic Path(InstallData idata, String path) throws Exception
setXXX(Path p)
attribute setters.idata - the install datapath - the path definition.Exceptionpublic Path()
public void setLocation(File location) throws Exception
location - the location of the element to add (must not be
null nor empty.Exceptionpublic void setPath(InstallData idata, String path) throws Exception
path - the String path definition.Exceptionpublic Path.PathElement createPathElement() throws Exception
<pathelement> element.Exceptionpublic void addFileset(FileSet fs) throws Exception
<fileset> element.Exceptionpublic void addFilelist(FileList fl) throws Exception
<filelist> element.Exceptionpublic void addDirset(DirSet dset) throws Exception
<dirset> element.Exceptionpublic Path createPath() throws Exception
<path> element.Exceptionpublic void append(Path other) throws Exception
Exceptionpublic void addExisting(Path source) throws Exception
source - - source path whose components are examined for existenceExceptionpublic void addExisting(Path source, boolean tryUserDir) throws Exception
source - tryUserDir - Exceptionpublic String[] list() throws Exception
Exceptionpublic String toString()
public static String[] translatePath(InstallData idata, String source)
public static String translateFile(String source)
protected static boolean translateFileSep(StringBuffer buffer, int pos)
public int size()
throws Exception
ExceptionCopyright © 2001–2025. All rights reserved.