| java.lang.Object org.mortbay.resource.Resource
All known Subclasses: org.mortbay.resource.URLResource,
Resource | abstract public class Resource implements Serializable(Code) | | Abstract resource class.
author: Nuno Pregui�a author: Greg Wilkins (gregw) |
__defaultUseCaches | public static boolean __defaultUseCaches(Code) | | |
addPath | abstract public Resource addPath(String path) throws IOException, MalformedURLException(Code) | | Returns the resource contained inside the current resource with the
given name.
Parameters: path - The path segment to add, which should be encoded by theencode method. |
encode | public String encode(String uri)(Code) | | Encode according to this resource type.
The default implementation calls URI.encodePath(uri)
Parameters: uri - String encoded for this resource type. |
exists | abstract public boolean exists()(Code) | | Returns true if the respresened resource exists.
|
finalize | protected void finalize()(Code) | | |
getAlias | public URL getAlias()(Code) | | The canonical Alias of this resource or null if none. |
getDefaultUseCaches | public static boolean getDefaultUseCaches()(Code) | | |
getFile | abstract public File getFile() throws IOException(Code) | | Returns an File representing the given resource or NULL if this
is not possible.
|
getListHTML | public String getListHTML(String base, boolean parent) throws IOException(Code) | | Get the resource list as a HTML directory listing.
Parameters: base - The base URL Parameters: parent - True if the parent directory should be included String of HTML |
getName | abstract public String getName()(Code) | | Returns the name of the resource
|
getURL | abstract public URL getURL()(Code) | | Returns an URL representing the given resource
|
isDirectory | abstract public boolean isDirectory()(Code) | | Returns true if the respresenetd resource is a container/directory.
If the resource is not a file, resources ending with "/" are
considered directories.
|
lastModified | abstract public long lastModified()(Code) | | Returns the last modified time
|
length | abstract public long length()(Code) | | Return the length of the resource
|
list | abstract public String[] list()(Code) | | Returns a list of resource names contained in the given resource
The resource names are not URL encoded.
|
newClassPathResource | public static Resource newClassPathResource(String resource)(Code) | | Find a classpath resource.
|
newClassPathResource | public static Resource newClassPathResource(String name, boolean useCaches, boolean checkParents)(Code) | | Find a classpath resource.
The
method is used to lookup the resource. If it is not
found, then the
Loader.getResource(ClassStringboolean) method is used.
If it is still not found, then
ClassLoader.getSystemResource(String) is used.
Unlike
Resource.getSystemResource this method does not check for normal resources.
Parameters: name - The relative name of the resouce Parameters: useCaches - True if URL caches are to be used. Parameters: checkParents - True if forced searching of parent classloaders is performed to work around loaders with inverted priorities Resource or null |
newResource | public static Resource newResource(URL url) throws IOException(Code) | | Construct a resource from a url.
Parameters: url - A URL. A Resource object. |
newResource | public static Resource newResource(URL url, boolean useCaches)(Code) | | Construct a resource from a url.
Parameters: url - the url for which to make the resource Parameters: useCaches - true enables URLConnection caching if applicable to the type of resource |
newResource | public static Resource newResource(String resource, boolean useCaches) throws MalformedURLException, IOException(Code) | | Construct a resource from a string.
Parameters: resource - A URL or filename. Parameters: useCaches - controls URLConnection caching A Resource object. |
newSystemResource | public static Resource newSystemResource(String resource) throws IOException(Code) | | Construct a system resource from a string.
The resource is tried as classloader resource before being
treated as a normal resource.
|
release | abstract public void release()(Code) | | Release any resources held by the resource.
|
setDefaultUseCaches | public static void setDefaultUseCaches(boolean useCaches)(Code) | | Change the default setting for url connection caches.
Subsequent URLConnections will use this default.
Parameters: useCaches - |
writeTo | public void writeTo(OutputStream out, long start, long count) throws IOException(Code) | | Parameters: out - Parameters: start - First byte to write Parameters: count - Bytes to write or -1 for all of them. |
|
|