Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.4.0)

E13403-05

javax.ide.net
Class URIPath

java.lang.Object
  extended by javax.ide.net.URIPath

public final class URIPath
extends java.lang.Object

An instance of URIPath represents a path that is made up entirely of URIs. This can be a class path, source path, doc path, etc.


Constructor Summary
URIPath()
          Creates a URIPath that is initially empty.
URIPath(int initialCapacity)
          Creates an empty URIPath with the specified initial capacity.
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" ).
URIPath(java.net.URI entry)
          Creates a URIPath that initially contains the specified URI as its sole entry.
URIPath(java.net.URI[] entries)
          Creates a URIPath initialized with the specified array of URI objects.
URIPath(URIPath uriPath)
          Copy constructor.
 
Method Summary
 void add(java.net.URI entry)
          Adds the given URI to the end of the URIPath, if it is not already on the URIPath.
 void add(java.net.URI[] entries)
          Adds the given URI objects in order to the end of the URIPath.
 void add(URIPath uriPath)
          Adds the entries from the specified URIPath to this instance.
 boolean contains(java.net.URI entry)
          Returns true if the specified URI is currently on this URIPath.
 boolean equals(java.lang.Object o)
          Returns true if the specified object equals this URI path.
protected  boolean equalsImpl(URIPath uriPath)
          This is a helper method for equals(Object) that can also be used by subclasses that implement equals(Object).
 java.net.URI[] getEntries()
          Returns the path represented by this URIPath instance as an array of URIs.
 int hashCode()
           
 java.util.Iterator iterator()
          Returns an Iterator whose elements are all instances of URI.
 void remove(java.net.URI entry)
          Remove the specified entry.
 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.
 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.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

URIPath

public URIPath()
Creates a URIPath that is initially empty.


URIPath

public URIPath(int initialCapacity)
Creates an empty URIPath with the specified initial capacity. Used to construct a URIPath whose contents are not initially known but where the number of entries can be estimated ahead of time.

Parameters:
initialCapacity - the initial capacity of the URIPath

URIPath

public URIPath(java.net.URI entry)
Creates a URIPath that initially contains the specified URI as its sole entry. If the entry is null, then the URIPath created is initially empty.


URIPath

public URIPath(java.net.URI[] entries)
Creates a URIPath initialized with the specified array of URI objects. If the entries array is null or empty, then the URIPath created is initially empty.


URIPath

public URIPath(URIPath uriPath)
Copy constructor.


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

public void add(URIPath uriPath)
Adds the entries from the specified URIPath to this instance.


getEntries

public java.net.URI[] 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).

See Also:
VirtualFileSystem.exists(java.net.URI)

equals

public boolean equals(java.lang.Object o)
Returns true if the specified object equals this URI path.

Overrides:
equals in class java.lang.Object

equalsImpl

protected final boolean equalsImpl(URIPath uriPath)
This is a helper method for equals(Object) that can also be used by subclasses that implement equals(Object). It assumes that the argument is not null.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.4.0)

E13403-05

Copyright © 1997, 2011, Oracle. All rights reserved.