站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc (Current Development Version)

ClassPath.Entry (Java Support APIs) - NetBeans API Javadoc (Current Development Version)

org.netbeans.api.java/1 1.13

org.netbeans.api.java.classpath
Class ClassPath.Entry

java.lang.Object
  extended by org.netbeans.api.java.classpath.ClassPath.Entry
Enclosing class:
ClassPath

public final class ClassPath.Entry
extends Object

Represents an individual entry in the ClassPath. An entry is a description of a folder, which is one of the ClassPath roots. Since the Entry does not control the folder's lifetime, the folder may be removed and the entry becomes invalid. It's also expected that ClassPath implementations may use other ClassPath entries as default or base for themselves, so Entries may be propagated between ClassPaths.


Method Summary
 ClassPath getDefiningClassPath()
          Returns the ClassPath instance, which defines/introduces the Entry.
 IOException getError()
          Retrieves the error condition of the Entry.
 FileObject getRoot()
          The method returns the root folder represented by the Entry.
 URL getURL()
          Returns URL of the class path root.
 boolean includes(FileObject file)
          Check whether a file is included in this entry.
 boolean includes(String resource)
          Check whether a file is included in this entry.
 boolean includes(URL file)
          Check whether a file is included in this entry.
 boolean isValid()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getDefiningClassPath

public ClassPath getDefiningClassPath()
Returns the ClassPath instance, which defines/introduces the Entry. Note that the return value may differ from the ClassPath instance, that produced this Entry from its entries() method.

Returns:
the ClassPath that defines the entry.

getRoot

public FileObject getRoot()
The method returns the root folder represented by the Entry. If the folder does not exist, or the folder is not readable, the method may return null.

Returns:
classpath entry root folder

isValid

public boolean isValid()
Returns:
true, iff the Entry refers to an existing and readable folder.

getError

public IOException getError()
Retrieves the error condition of the Entry. The method will return null, if the getRoot() would return a FileObject.

Returns:
error condition for this Entry or null if the Entry is OK.

getURL

public URL getURL()
Returns URL of the class path root. This method is generally safer than getRoot() as it can be called even if the root does not currently exist.

Returns:
URL
Since:
org.netbeans.api.java/1 1.4

includes

public boolean includes(String resource)
Check whether a file is included in this entry.

Parameters:
resource - a path relative to @{link #getURL} (must be terminted with / if a non-root folder)
Returns:
true if it is included
Since:
org.netbeans.api.java/1 1.13

includes

public boolean includes(URL file)
Check whether a file is included in this entry.

Parameters:
file - a URL beneath @{link #getURL}
Returns:
true if it is included
Throws:
IllegalArgumentException - in case the argument is not beneath getURL()
Since:
org.netbeans.api.java/1 1.13

includes

public boolean includes(FileObject file)
Check whether a file is included in this entry.

Parameters:
file - a file inside @{link #getRoot}
Returns:
true if it is included
Throws:
IllegalArgumentException - in case the argument is not beneath getRoot(), or getRoot() is null
Since:
org.netbeans.api.java/1 1.13

toString

public String toString()
Overrides:
toString in class Object

org.netbeans.api.java/1 1.13

Built on May 28 2007.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.