|
ESC/Java2 © 2003,2004,2005 David Cok and Joseph Kiniry © 2005 UCD Dublin © 2003,2004 Radboud University Nijmegen © 1999,2000 Compaq Computer Corporation © 1997,1998,1999 Digital Equipment Corporation All Rights Reserved |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A GenericFile is a least-common-denominator representation of a read-only file (or directory).
Note: The existence of GenericFile does not imply the actual existence of an underlying file.
Currently, GenericFile's can be created from normal files (java.io.File) and zipfile entries (java.util.zip.ZipEntry).
Additional operations on GenericFiles will be added later as needed.
Method Summary | |
java.lang.String |
getCanonicalID()
Return a String that canonically represents the identity of our underlying file. |
java.lang.String |
getHumanName()
Return a name that uniquely identifies us to the user. |
java.io.InputStream |
getInputStream()
Open the file we represent as an InputStream. |
java.lang.String |
getLocalName()
Return our local name, the name that distinguishes us within the directory that contains us. |
GenericFile |
getSibling(java.lang.String n)
Attempt to return a GenericFile that describes the file in the same "directory" as us that has the local name n . |
boolean |
isDirectory()
Do we represent a directory? |
long |
lastModified()
Returns the time that the file represented by us was last modified. |
Method Detail |
public java.lang.String getHumanName()
public java.lang.String getCanonicalID()
public java.lang.String getLocalName()
public boolean isDirectory()
public java.io.InputStream getInputStream() throws java.io.IOException
java.io.IOEXception may be thrown for many reasons, including no such file and read permission denied.
java.io.IOException
public long lastModified()
The return value is system dependent and should only be used to compare with other values returned by last modified. It should not be interpreted as an absolute time.
If a last-modified time is not available (e.g., underlying file doesn't exist, no time specified in a zipentry, etc.), then 0L is returned.
public GenericFile getSibling(java.lang.String n)
n
. No attempt is made to verify whether or not that file exists.
In cases where the notion of "containing directory" makes no sense (e.g., streams or root directories), null is returned.
|
ESC/Java2 © 2003,2004,2005 David Cok and Joseph Kiniry © 2005 UCD Dublin © 2003,2004 Radboud University Nijmegen © 1999,2000 Compaq Computer Corporation © 1997,1998,1999 Digital Equipment Corporation All Rights Reserved |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |