|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.mortbay.util.Resource | +--org.mortbay.util.CachedResource
Cached resource class. This resource caches in memory the contents of another resource. The update() method must be called to check if the real resource has been modified.
Method Summary | |
Resource |
addPath(java.lang.String path)
Returns the resource contained inside the current resource with the given name |
void |
clear()
|
boolean |
delete()
Deletes the given resource |
boolean |
equals(java.lang.Object o)
|
boolean |
exists()
Returns true if the respresened resource exists. |
byte[] |
getCachedData()
|
java.io.File |
getFile()
Returns an File representing the given resource or NULL if this is not possible. |
java.io.InputStream |
getInputStream()
Returns an input stream to the resource |
java.lang.String |
getName()
Returns the name of the resource |
java.io.OutputStream |
getOutputStream()
Returns an output stream to the resource |
java.net.URL |
getURL()
Returns an URL representing the given resource |
int |
hashCode()
|
boolean |
isDirectory()
Returns true if the respresenetd resource is a container/directory. |
boolean |
isUptoDate()
|
long |
lastModified()
Returns the last modified time |
long |
length()
Return the length of the resource |
java.lang.String[] |
list()
Returns a list of resource names contained in the given resource |
void |
release()
Release any resources held by the resource. |
boolean |
renameTo(Resource dest)
Rename the given resource |
void |
setCachedData(byte[] buf)
|
java.lang.String |
toString()
|
boolean |
update()
|
void |
writeTo(java.io.OutputStream os,
long startByte,
long count)
|
Methods inherited from class org.mortbay.util.Resource |
cache, encode, getAlias, getAssociate, getListHTML, newResource, newResource, newSystemResource, setAssociate |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
public boolean isUptoDate() throws java.io.IOException
java.io.IOException
public boolean update() throws java.io.IOException
java.io.IOException
public void clear()
public void release()
release
in class Resource
public boolean exists()
exists
in class Resource
public boolean isDirectory()
Resource
isDirectory
in class Resource
public long lastModified()
Resource
lastModified
in class Resource
public long length()
Resource
length
in class Resource
public java.net.URL getURL()
Resource
getURL
in class Resource
public java.io.File getFile() throws java.io.IOException
Resource
getFile
in class Resource
java.io.IOException
public java.lang.String getName()
getName
in class Resource
public java.io.InputStream getInputStream() throws java.io.IOException
getInputStream
in class Resource
java.io.IOException
public java.io.OutputStream getOutputStream() throws java.io.IOException, java.lang.SecurityException
getOutputStream
in class Resource
java.io.IOException
java.lang.SecurityException
public boolean delete() throws java.lang.SecurityException
delete
in class Resource
java.lang.SecurityException
public boolean renameTo(Resource dest) throws java.lang.SecurityException
renameTo
in class Resource
java.lang.SecurityException
public java.lang.String[] list()
list
in class Resource
public Resource addPath(java.lang.String path) throws java.io.IOException, java.net.MalformedURLException
addPath
in class Resource
path
- The path segment to add, which should be encoded by the
encode method.
java.io.IOException
java.net.MalformedURLException
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public void writeTo(java.io.OutputStream os, long startByte, long count) throws java.io.IOException
writeTo
in class Resource
os
- startByte
- First byte to writecount
- Bytes to write or -1 for all of them.
java.io.IOException
public byte[] getCachedData()
public void setCachedData(byte[] buf)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |