| Constructor and Description |
|---|
FileResource(FileRepository repository,
java.io.File f) |
| Modifier and Type | Method and Description |
|---|---|
Resource |
clone(java.lang.String cloneName)
Clones this resource with a new resource with a different name
|
boolean |
exists()
Determine if the resource is available.
|
long |
getContentLength()
Get the resource size
|
java.io.File |
getFile() |
long |
getLastModified()
Get the date the resource was last modified
|
java.lang.String |
getName()
Get the name of the resource.
|
FileRepository |
getRepository() |
boolean |
isLocal()
Is this resource local to this host, i.e. is it on the file system?
|
java.io.InputStream |
openStream()
Opens a stream on this resource
|
java.lang.String |
toString() |
public FileResource(FileRepository repository, java.io.File f)
public java.lang.String getName()
Resourcepublic Resource clone(java.lang.String cloneName)
Resourcepublic long getLastModified()
ResourcegetLastModified in interface Resourcelong value representing the time the file was last modified, measured
in milliseconds since the epoch (00:00:00 GMT, January 1, 1970), or 0L
if the file does not exist or if an I/O error occurs.public long getContentLength()
ResourcegetContentLength in interface Resourcelong value representing the size of the resource in bytes.public boolean exists()
Resourcepublic java.lang.String toString()
toString in class java.lang.Objectpublic java.io.File getFile()
public FileRepository getRepository()
public boolean isLocal()
Resourcepublic java.io.InputStream openStream()
throws java.io.IOException
ResourceopenStream in interface Resourcejava.io.IOException