Class TokenizedPath
- java.lang.Object
- 
- org.apache.tools.ant.types.selectors.TokenizedPath
 
- 
 public class TokenizedPath extends java.lang.ObjectContainer for a path that has been split into its components.- Since:
- 1.8.0
 
- 
- 
Field SummaryFields Modifier and Type Field Description static TokenizedPathEMPTY_PATHInstance that holds no tokens at all.
 - 
Constructor SummaryConstructors Constructor Description TokenizedPath(java.lang.String path)Initialize the TokenizedPath by parsing it.TokenizedPath(TokenizedPath parent, java.lang.String child)Creates a new path as a child of another path.
 - 
Method SummaryModifier and Type Method Description intdepth()The depth (or length) of a path.booleanequals(java.lang.Object o)true if the original paths are equal.java.io.FilefindFile(java.io.File base, boolean cs)Frombasetraverse the filesystem in order to find a file that matches the given name.inthashCode()booleanisSymlink(java.io.File base)Do we have to traverse a symlink when trying to reach path from basedir?TokenizedPatterntoPattern()Creates a TokenizedPattern from the same tokens that make up this path.java.lang.StringtoString()
 
- 
- 
- 
Field Detail- 
EMPTY_PATHpublic static final TokenizedPath EMPTY_PATH Instance that holds no tokens at all.
 
- 
 - 
Constructor Detail- 
TokenizedPathpublic TokenizedPath(java.lang.String path) Initialize the TokenizedPath by parsing it.- Parameters:
- path- The path to tokenize. Must not be- null.
 
 - 
TokenizedPathpublic TokenizedPath(TokenizedPath parent, java.lang.String child) Creates a new path as a child of another path.- Parameters:
- parent- the parent path
- child- the child, must not contain the file separator
 
 
- 
 - 
Method Detail- 
toStringpublic java.lang.String toString() - Overrides:
- toStringin class- java.lang.Object
- Returns:
- The original path String
 
 - 
depthpublic int depth() The depth (or length) of a path.- Returns:
- int
 
 - 
findFilepublic java.io.File findFile(java.io.File base, boolean cs)Frombasetraverse the filesystem in order to find a file that matches the given name.- Parameters:
- base- base File (dir).
- cs- whether to scan case-sensitively.
- Returns:
- File object that points to the file in question or null.
 
 - 
isSymlinkpublic boolean isSymlink(java.io.File base) Do we have to traverse a symlink when trying to reach path from basedir?- Parameters:
- base- base File (dir).
- Returns:
- boolean
 
 - 
equalspublic boolean equals(java.lang.Object o) true if the original paths are equal.- Overrides:
- equalsin class- java.lang.Object
- Returns:
- boolean
 
 - 
hashCodepublic int hashCode() - Overrides:
- hashCodein class- java.lang.Object
 
 - 
toPatternpublic TokenizedPattern toPattern() Creates a TokenizedPattern from the same tokens that make up this path.- Returns:
- TokenizedPattern
 
 
- 
 
-