|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openqa.jetty.util.Resource
org.openqa.jetty.util.CachedResource
public class 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(String path)
Returns the resource contained inside the current resource with the given name |
void |
clear()
|
boolean |
delete()
Deletes the given resource |
boolean |
equals(Object o)
|
boolean |
exists()
Returns true if the respresened resource exists. |
byte[] |
getCachedData()
|
File |
getFile()
Returns an File representing the given resource or NULL if this is not possible. |
InputStream |
getInputStream()
Returns an input stream to the resource |
String |
getName()
Returns the name of the resource |
OutputStream |
getOutputStream()
Returns an output stream to the resource |
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 |
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)
|
String |
toString()
|
boolean |
update()
|
void |
writeTo(OutputStream os,
long startByte,
long count)
|
Methods inherited from class org.openqa.jetty.util.Resource |
---|
cache, encode, finalize, getAlias, getAssociate, getListHTML, newResource, newResource, newSystemResource, setAssociate |
Methods inherited from class java.lang.Object |
---|
clone, getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public boolean isUptoDate() throws IOException
IOException
public boolean update() throws IOException
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 URL getURL()
Resource
getURL
in class Resource
public File getFile() throws IOException
Resource
getFile
in class Resource
IOException
public String getName()
getName
in class Resource
public InputStream getInputStream() throws IOException
getInputStream
in class Resource
IOException
public OutputStream getOutputStream() throws IOException, SecurityException
getOutputStream
in class Resource
IOException
SecurityException
public boolean delete() throws SecurityException
delete
in class Resource
SecurityException
public boolean renameTo(Resource dest) throws SecurityException
renameTo
in class Resource
SecurityException
public String[] list()
list
in class Resource
public Resource addPath(String path) throws IOException, MalformedURLException
addPath
in class Resource
path
- The path segment to add, which should be encoded by the
encode method.
IOException
MalformedURLException
public String toString()
toString
in class Object
public int hashCode()
hashCode
in class Object
public boolean equals(Object o)
equals
in class Object
public void writeTo(OutputStream os, long startByte, long count) throws IOException
writeTo
in class Resource
startByte
- First byte to writecount
- Bytes to write or -1 for all of them.
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 |