|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.mortbay.util.Resource
Class that represents a resource accessible through the file or URL
Method Summary | |
Resource |
addPath(java.lang.String path)
Returns the resource contained inside the current resource with the given name |
static java.lang.String |
canonicalPath(java.lang.String path)
Convert a path to a cananonical form. |
boolean |
delete()
Deletes the given resource |
boolean |
equals(java.lang.Object o)
|
boolean |
exists()
Returns true if the respresened resource exists. |
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. |
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 |
static Resource |
newResource(java.lang.String resource)
Construct a resource from a string. |
static Resource |
newResource(java.net.URL url)
|
static Resource |
newSystemResource(java.lang.String resource)
Construct a system resource from a string. |
void |
release()
Release any resources held by the resource. |
boolean |
renameTo(Resource dest)
Rename the given resource |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
public static Resource newResource(java.net.URL url) throws java.io.IOException
url
- public static Resource newResource(java.lang.String resource) throws java.net.MalformedURLException, java.io.IOException
resource.
- public static Resource newSystemResource(java.lang.String resource) throws java.io.IOException
resource.
- public void release()
public boolean exists()
public boolean isDirectory()
public long lastModified()
public long length()
public java.net.URL getURL()
public java.io.File getFile()
public java.lang.String getName()
public java.io.InputStream getInputStream() throws java.io.IOException
public java.io.OutputStream getOutputStream() throws java.io.IOException, java.lang.SecurityException
public boolean delete() throws java.lang.SecurityException
public boolean renameTo(Resource dest) throws java.lang.SecurityException
public java.lang.String[] list()
public Resource addPath(java.lang.String path) throws 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 static java.lang.String canonicalPath(java.lang.String path)
path
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |