|
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 |
java.lang.Objectjavafe.genericfile.UnopenableFile
Instances of UnopenableFile are GenericFile
s that cannot
be opened.
Their value lies solely in their associated naming, etc., info.
Example: CorrelatedReader
's keeps an open
InputStream
and an associated GenericFile
. In the
case of unreopenable streams like stdin, the associated GenericFile
is an UnopenableFile with the name "stdin".
Field Summary | |
(package private) java.lang.String |
humanName
* Instance variables: * * |
(package private) boolean |
isDir
|
Constructor Summary | |
UnopenableFile(java.lang.String name)
Create a ordinary (aka, non-directory) UnopenableFile with human-name name. |
|
UnopenableFile(java.lang.String name,
boolean isDir)
Create an UnopenableFile with human-name name that is a directory iff isDir. |
Method Summary | |
java.lang.String |
getCanonicalID()
Return a String that canonically represents the identity of our underlying file. |
java.lang.String |
getHumanName()
* GenericFile interface implementation: * * |
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
java.lang.String humanName
boolean isDir
Constructor Detail |
public UnopenableFile(java.lang.String name)
public UnopenableFile(java.lang.String name, boolean isDir)
Method Detail |
public java.lang.String getHumanName()
getHumanName
in interface GenericFile
public java.lang.String getCanonicalID()
GenericFile
getCanonicalID
in interface GenericFile
public java.lang.String getLocalName()
GenericFile
getLocalName
in interface GenericFile
public boolean isDirectory()
GenericFile
isDirectory
in interface GenericFile
public java.io.InputStream getInputStream() throws java.io.IOException
GenericFile
java.io.IOEXception may be thrown for many reasons, including no such file and read permission denied.
getInputStream
in interface GenericFile
java.io.IOException
public long lastModified()
GenericFile
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.
lastModified
in interface GenericFile
public GenericFile getSibling(java.lang.String n)
GenericFile
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.
getSibling
in interface GenericFile
|
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 |