org.mortbay.util
Class URLResource
- Serializable
Abstract resource class.
$Id: URLResource.java,v 1.9 2005/08/13 00:01:28 gregwilkins Exp $- Nuno Preguiça
- Greg Wilkins (gregw)
Resource | addPath(String path) - Returns the resource contained inside the current resource with the
given name
|
protected boolean | checkConnection()
|
boolean | delete() - Deletes the given resource
|
boolean | equals(Object o)
|
boolean | exists() - Returns true if the respresened resource exists.
|
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.
|
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
|
String | toString()
|
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 |
_connection
protected URLConnection _connection
_in
protected InputStream _in
_urlString
protected String _urlString
URLResource
protected URLResource(URL url,
URLConnection connection)
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
checkConnection
protected boolean checkConnection()
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
getFile
public File getFile()
throws IOException
Returns an File representing the given resource or NULL if this
is not possible.
- 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
getURL
public URL getURL()
Returns an URL representing the given resource
- getURL in interface Resource
hashCode
public int hashCode()
isDirectory
public boolean isDirectory()
Returns true if the respresenetd resource is a container/directory.
If the resource is not a file, resources ending with "/" are
considered directories.
- isDirectory in interface Resource
lastModified
public long lastModified()
Returns the last modified time
- lastModified in interface Resource
length
public long length()
Return the length of the resource
- length in interface Resource
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
toString
public String toString()
Copyright © 2004 Mortbay Consulting Pty. Ltd. All Rights Reserved.