org.mortbay.util
Class CachedResource
- Serializable
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.
$Id: CachedResource.java,v 1.6 2004/05/09 20:32:49 gregwilkins Exp $
addPath , cache , delete , encode , exists , finalize , getAlias , getAssociate , getFile , getInputStream , getListHTML , getName , getOutputStream , getURL , isDirectory , lastModified , length , list , newResource , newResource , newSystemResource , release , renameTo , setAssociate , writeTo |
addPath
public Resource addPath(String path)
throws IOException,
MalformedURLException
Returns the resource contained inside the current resource with the
given name
- addPath in interface Resource
delete
public boolean delete()
throws SecurityException
Deletes the given resource
- delete in interface Resource
equals
public boolean equals(Object o)
exists
public boolean exists()
Returns true if the respresened resource exists.
- exists in interface Resource
getCachedData
public byte[] getCachedData()
getFile
public File getFile()
throws IOException
- getFile in interface Resource
getInputStream
public InputStream getInputStream()
throws IOException
Returns an input stream to the resource
- getInputStream in interface Resource
getName
public String getName()
Returns the name of the resource
- getName in interface Resource
getOutputStream
public OutputStream getOutputStream()
throws IOException,
SecurityException
Returns an output stream to the resource
- getOutputStream in interface Resource
hashCode
public int hashCode()
isUptoDate
public boolean isUptoDate()
throws IOException
list
public String[] list()
Returns a list of resource names contained in the given resource
- list in interface Resource
release
public void release()
Release any resources held by the resource.
- release in interface Resource
renameTo
public boolean renameTo(Resource dest)
throws SecurityException
Rename the given resource
- renameTo in interface Resource
setCachedData
public void setCachedData(byte[] buf)
toString
public String toString()
update
public boolean update()
throws IOException
writeTo
public void writeTo(OutputStream os,
long startByte,
long count)
throws IOException
- writeTo in interface Resource
Copyright © 2004 Mortbay Consulting Pty. Ltd. All Rights Reserved.