Top Description Fields Constructors Methods
org.mortbay.resource

pack-priv Class BadResource

extends URLResource
Class Inheritance
Imports
java.io.File, .FileNotFoundException, .IOException, .InputStream, .OutputStream, java.net.URL

Bad Resource. A Resource that is returned for a bade URL. Acts as a resource that does not exist and throws appropriate exceptions.
Author
Greg Wilkins (gregw)

Field Summary

Modifier and TypeField and Description
private String
Inherited from org.mortbay.resource.URLResource:
_connection_in_url_urlString_useCaches

Constructor Summary

AccessConstructor and Description
pack-priv
BadResource(URL url, String message)

Method Summary

Modifier and TypeMethod and Description
public boolean
delete()

Overrides org.mortbay.resource.URLResource.delete.

Deletes the given resource
public boolean
exists()

Overrides org.mortbay.resource.URLResource.exists.

Returns true if the represented resource exists.
public File
getFile()

Overrides org.mortbay.resource.URLResource.getFile.

Returns an File representing the given resource or NULL if this is not possible.
public InputStream
getInputStream()

Overrides org.mortbay.resource.URLResource.getInputStream.

Returns an input stream to the resource
public OutputStream
getOutputStream()

Overrides org.mortbay.resource.URLResource.getOutputStream.

Returns an output stream to the resource
public boolean
isDirectory()

Overrides org.mortbay.resource.URLResource.isDirectory.

Returns true if the respresenetd resource is a container/directory.
public long
lastModified()

Overrides org.mortbay.resource.URLResource.lastModified.

Returns the last modified time
public long
length()

Overrides org.mortbay.resource.URLResource.length.

Return the length of the resource
public String[]
list()

Overrides org.mortbay.resource.URLResource.list.

Returns a list of resource names contained in the given resource
public boolean
renameTo(Resource dest)

Overrides org.mortbay.resource.URLResource.renameTo.

Rename the given resource
public String
toString()

Overrides org.mortbay.resource.URLResource.toString.

Returns a string representation of the object.
Inherited from org.mortbay.resource.URLResource:
addPathcheckConnectionequalsgetNamegetURLgetUseCacheshashCoderelease

Field Detail

_messageback to summary
private String _message

Constructor Detail

BadResourceback to summary
pack-priv BadResource(URL url, String message)

Method Detail

deleteback to summary
public boolean delete() throws SecurityException

Overrides org.mortbay.resource.URLResource.delete.

Doc from org.mortbay.resource.URLResource.delete.

Deletes the given resource

existsback to summary
public boolean exists()

Overrides org.mortbay.resource.URLResource.exists.

Doc from org.mortbay.resource.URLResource.exists.

Returns true if the represented resource exists.

getFileback to summary
public File getFile()

Overrides org.mortbay.resource.URLResource.getFile.

Doc from org.mortbay.resource.URLResource.getFile.

Returns an File representing the given resource or NULL if this is not possible.

getInputStreamback to summary
public InputStream getInputStream() throws IOException

Overrides org.mortbay.resource.URLResource.getInputStream.

Doc from org.mortbay.resource.URLResource.getInputStream.

Returns an input stream to the resource

getOutputStreamback to summary
public OutputStream getOutputStream() throws IOException, SecurityException

Overrides org.mortbay.resource.URLResource.getOutputStream.

Doc from org.mortbay.resource.URLResource.getOutputStream.

Returns an output stream to the resource

isDirectoryback to summary
public boolean isDirectory()

Overrides org.mortbay.resource.URLResource.isDirectory.

Doc from org.mortbay.resource.URLResource.isDirectory.

Returns true if the respresenetd resource is a container/directory. If the resource is not a file, resources ending with "/" are considered directories.

lastModifiedback to summary
public long lastModified()

Overrides org.mortbay.resource.URLResource.lastModified.

Doc from org.mortbay.resource.URLResource.lastModified.

Returns the last modified time

lengthback to summary
public long length()

Overrides org.mortbay.resource.URLResource.length.

Doc from org.mortbay.resource.URLResource.length.

Return the length of the resource

listback to summary
public String[] list()

Overrides org.mortbay.resource.URLResource.list.

Doc from org.mortbay.resource.URLResource.list.

Returns a list of resource names contained in the given resource

renameToback to summary
public boolean renameTo(Resource dest) throws SecurityException

Overrides org.mortbay.resource.URLResource.renameTo.

Doc from org.mortbay.resource.URLResource.renameTo.

Rename the given resource

toStringback to summary
public String toString()

Overrides org.mortbay.resource.URLResource.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object