Top Description Fields Constructors Methods
org.apache.tools.ant

public Class PathTokenizer

extends Object
Class Inheritance
Imports
java.io.File, java.util.NoSuchElementException, .StringTokenizer, org.apache.tools.ant.taskdefs.condition.Os

A Path tokenizer takes a path and returns the components that make up that path. The path can use path separators of either ':' or ';' and file separators of either '/' or '\'.

Field Summary

Modifier and TypeField and Description
private boolean
dosStyleFilesystem

Flag to indicate whether or not we are running on a platform with a DOS style filesystem

private String
lookahead

A String which stores any path components which have been read ahead due to DOS filesystem compensation.

private boolean
onNetWare

A boolean that determines if we are running on Novell NetWare, which exhibits slightly different path name characteristics (multi-character volume / drive names)

private StringTokenizer
tokenizer

A tokenizer to break the string up based on the ':' or ';' separators.

Constructor Summary

AccessConstructor and Description
public
PathTokenizer(String
The path to tokenize. Must not be null.
path
)

Constructs a path tokenizer for the specified path.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if and only if there is at least one token in the string after the current position; false otherwise.
hasMoreTokens
()

Tests if there are more path elements available from this tokenizer's path.

public String

Returns:

the next path element from this tokenizer.
nextToken
()

Returns the next path element from this tokenizer.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

dosStyleFilesystemback to summary
private boolean dosStyleFilesystem

Flag to indicate whether or not we are running on a platform with a DOS style filesystem

lookaheadback to summary
private String lookahead

A String which stores any path components which have been read ahead due to DOS filesystem compensation.

onNetWareback to summary
private boolean onNetWare

A boolean that determines if we are running on Novell NetWare, which exhibits slightly different path name characteristics (multi-character volume / drive names)

tokenizerback to summary
private StringTokenizer tokenizer

A tokenizer to break the string up based on the ':' or ';' separators.

Constructor Detail

PathTokenizerback to summary
public PathTokenizer(String path)

Constructs a path tokenizer for the specified path.

Parameters
path:String

The path to tokenize. Must not be null.

Method Detail

hasMoreTokensback to summary
public boolean hasMoreTokens()

Tests if there are more path elements available from this tokenizer's path. If this method returns true, then a subsequent call to nextToken will successfully return a token.

Returns:boolean

true if and only if there is at least one token in the string after the current position; false otherwise.

nextTokenback to summary
public String nextToken() throws NoSuchElementException

Returns the next path element from this tokenizer.

Returns:String

the next path element from this tokenizer.

Exceptions
NoSuchElementException:
if there are no more elements in this tokenizer's path.