public abstract class LazyResource extends java.lang.Object implements Resource
| Constructor and Description |
|---|
LazyResource(java.lang.String name) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
exists()
Determine if the resource is available.
|
long |
getContentLength()
Get the resource size
|
long |
getLastModified()
Get the date the resource was last modified
|
java.lang.String |
getName()
Get the name of the resource.
|
protected abstract void |
init() |
protected void |
init(Resource r) |
boolean |
isLocal()
Is this resource local to this host, i.e. is it on the file system?
|
protected void |
setContentLength(long contentLength) |
protected void |
setExists(boolean exists) |
protected void |
setLastModified(long lastModified) |
protected void |
setLocal(boolean local) |
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitclone, openStreamprotected abstract void init()
public boolean exists()
Resourcepublic long getContentLength()
ResourcegetContentLength in interface Resourcelong value representing the size of the resource in bytes.public 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 java.lang.String getName()
Resourcepublic boolean isLocal()
Resourcepublic java.lang.String toString()
toString in class java.lang.Objectprotected void setContentLength(long contentLength)
protected void setExists(boolean exists)
protected void setLastModified(long lastModified)
protected void setLocal(boolean local)
protected void init(Resource r)