URIPath

URIPath

public URIPath(java.lang.String entries)

Contructor for creating a URIPath
instance based on a typical path string, such as that that is
returned by System.getProperty( "java.class.path" ).
The exact format of the path string is platform-dependent, so the
path string is tokenized using File.pathSeparator as the
delimiter.

Relative paths are converted to absolute paths, and any path
entries whose name ends in ".jar" or
".zip" will be created as jar URIs (i.e.
an URI with the "jar" scheme).

Method Detail

add

public void add(java.net.URI entry)

Adds the given URI to the end of the URIPath,
if it is not already on the URIPath. If the
parameter is null, then this method returns without
doing anything.

add

public void add(java.net.URI[] entries)

Adds the given URI objects in order to the end of the
URIPath. Each URI is added only if it is
not already on the URIPath. Any null
entries are ignored. If the entries array itself
is null, then this method returns without doing anything.

add

getEntries

Returns the path represented by this URIPath
instance as an array of URIs. If the
URIPath is empty, then then this method returns an
URI array of size 0.

contains

public boolean contains(java.net.URI entry)

Returns true if the specified URI is
currently on this URIPath.

remove

public void remove(java.net.URI entry)

Remove the specified entry.

Parameters:

entry - the entry to remove.

iterator

public java.util.Iterator iterator()

Returns an Iterator whose elements are all instances of
URI. Calling the remove() method on the iterator will
write through and change the URIPath.

toRelativePath

public java.lang.String toRelativePath(java.net.URI uri)

Given an URI, this method attempts to derive its relative
path with respect to this instance of URIPath. If
the specified URI does not point to a location that is
on this URIPath, then null is returned.

toQualifiedURI

public java.net.URI toQualifiedURI(java.lang.String relativePath)

Given a relative spec, this method attempts to construct a fully
qualified URI that points to the corresponding resource
on this URIPath. If no matching URI can be
constructed, then null is returned. An URI is
deemed to match iff the URI points to an existing resource.
In practical terms, it means that calling the method exists()
on VirtualFileSystem returns true.
Note that toQualifiedURI will generally return null if the
desired resource only exists in memory (for example, if it is bound to
an unsaved Document).