|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.pf.file.ClasspathElement
public class ClasspathElement
Represents one entry in a classpath. It can be asked if it s a directory or an archive. It also can be asked if it exists and it is valid (really a zip archive).
| Constructor Summary | |
|---|---|
ClasspathElement(java.io.File aFile)
Initialize the new instance with a file representing either a directory or an archive file. |
|
ClasspathElement(java.lang.String elementName)
Initialize the new instance with default values. |
|
| Method Summary | |
|---|---|
void |
close()
Close any underlying (maybe) opened archive |
boolean |
contains(java.lang.String filename)
Returns whether or not this element contains a file with the given name. |
java.net.URL |
createURL(java.lang.String filename)
Creates a URL for the file with the given name that is in this file container. |
boolean |
equals(java.lang.Object object)
Returns true if the given object is equal to this object |
boolean |
exists()
Returns whether or not this classpath element exists. |
FileInfo |
getFileInfo(java.lang.String filename)
Returns a file info object for the given filename which is expected to be inside the directory or archive represented by this classpath element. |
java.lang.String |
getName()
Returns the name of this classpath element |
java.net.URL |
getURL()
Returns a URL that points to this classpath element. |
int |
hashCode()
Returns the hash value of this object |
boolean |
isArchive()
Returns true, if this element is an archive file. |
boolean |
isDirectory()
Returns true, if this element is a directory |
boolean |
isFile()
Returns true, if this element is a file. |
boolean |
isOpen()
Returns true, if this element represents an archive (zip file) and that archive is currently open. |
boolean |
isValid()
Returns true, if this element is either a valid directory or really an archive (zip file). |
boolean |
leaveArchiveOpen()
Returns true, if an opened archive stays open until method close() gets called. |
void |
leaveArchiveOpen(boolean newValue)
Sets whether an opened archive stays open until method close() gets called. |
java.io.InputStream |
open(java.lang.String filename)
Opens the file with the given name in this classpath element and returns the input stream. |
java.lang.String |
toString()
Returns the element's string representation. |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ClasspathElement(java.io.File aFile)
aFile - A file representing an element in a classpathpublic ClasspathElement(java.lang.String elementName)
| Method Detail |
|---|
public java.lang.String getName()
public boolean leaveArchiveOpen()
close()public void leaveArchiveOpen(boolean newValue)
close()public boolean exists()
public boolean isFile()
public boolean isArchive()
public boolean isDirectory()
public boolean isValid()
public boolean isOpen()
public boolean contains(java.lang.String filename)
filename - The name of the file to be looked forpublic FileInfo getFileInfo(java.lang.String filename)
filename - The name of the file to be looked for
public java.io.InputStream open(java.lang.String filename)
throws java.io.IOException
filename - The name of the file in this container to be opened
java.io.IOExceptionpublic void close()
public java.net.URL getURL()
public java.net.URL createURL(java.lang.String filename)
public java.lang.String toString()
toString in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.ObjectObject.hashCode()public boolean equals(java.lang.Object object)
equals in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||