attrib4j.utensil
Class PathUtil

java.lang.Object
  |
  +--attrib4j.utensil.PathUtil

public class PathUtil
extends java.lang.Object

Modifed for Attrib4j to only take the utility method to convert path names to the correct platform representation. This object represents a path as used by CLASSPATH or PATH environment variable.

<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.

Author:
Thomas.Haas@softwired-inc.com, Stefan Bodewig

Constructor Summary
PathUtil()
           
 
Method Summary
protected static boolean translateFileSep(java.lang.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 java.lang.String[] translatePath(java.lang.String source)
          Splits a PATH (with : or ; as separators) into its parts.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PathUtil

public PathUtil()
Method Detail

translatePath

public static java.lang.String[] translatePath(java.lang.String source)
Splits a PATH (with : or ; as separators) into its parts.


translateFileSep

protected static boolean translateFileSep(java.lang.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.



Copyright © 2002-2003 Mark Pollack. All Rights Reserved.