|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ckkloverdos.resource.FileResource
public class FileResource
File-based resource.
Constructor Summary | |
---|---|
FileResource(java.io.File file)
Constructs a new instance from the given file. |
|
FileResource(java.lang.String name)
Constructs a new instance from the given file name. |
Method Summary | |
---|---|
boolean |
exists()
Returns true iff the resource exists. |
java.io.File |
getFile()
Returns the file object for this resource. |
java.io.InputStream |
getInputStream()
Returns a new FileInputStream constructed from the
resource file. |
java.lang.String |
getName()
Returns the file name of this resource. |
java.net.URL |
getURL()
Returns the URL representation of the resource file. |
boolean |
isDirectory()
Returns true iff the resource is a directory. |
boolean |
isFile()
Returns true iff the resource is a file. |
java.lang.String |
toString()
|
void |
toStringAware(ToString ts)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public FileResource(java.io.File file)
file
- public FileResource(java.lang.String name)
name
- Method Detail |
---|
public boolean exists()
true
iff the resource exists.
exists
in interface IResource
public boolean isFile()
true
iff the resource is a file.
This always returns true
for a FileResource
.
You should consult exists()
to see if the file exists.
isFile
in interface IResource
public boolean isDirectory()
true
iff the resource is a directory.
public java.io.File getFile()
getFile
in interface IResource
public java.lang.String getName()
getName
in interface IResource
public java.net.URL getURL()
getFile().toURL()
.
getURL
in interface IResource
public java.io.InputStream getInputStream() throws java.io.IOException
FileInputStream
constructed from the
resource file.
getInputStream
in interface IResource
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object
public void toStringAware(ToString ts)
toStringAware
in interface IToStringAware
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |