Package org.apache.catalina
Interface WebResource
- 
- All Known Implementing Classes:
- AbstractArchiveResource,- AbstractResource,- AbstractSingleArchiveResource,- CachedResource,- EmptyResource,- FileResource,- JarResource,- JarResourceRoot,- JarWarResource,- VirtualResource,- WarResource
 
 public interface WebResourceRepresents a file or directory within a web application. It borrows heavily fromFile.
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancanRead()booleandelete()booleanexists()java.lang.StringgetCanonicalPath()java.security.cert.Certificate[]getCertificates()java.net.URLgetCodeBase()byte[]getContent()longgetContentLength()longgetCreation()java.lang.StringgetETag()Return the strong ETag if available (currently not supported) else return the weak ETag calculated from the content length and last modified.java.io.InputStreamgetInputStream()Obtain an InputStream based on the contents of this resource.longgetLastModified()java.lang.StringgetLastModifiedHttp()java.util.jar.ManifestgetManifest()java.lang.StringgetMimeType()java.lang.StringgetName()java.net.URLgetURL()java.lang.StringgetWebappPath()WebResourceRootgetWebResourceRoot()booleanisDirectory()booleanisFile()booleanisVirtual()Indicates if this resource is required for applications to correctly scan the file structure but that does not exist in either the main or any additionalWebResourceSet.voidsetMimeType(java.lang.String mimeType)Set the MIME type for this Resource.
 
- 
- 
- 
Method Detail- 
getLastModifiedlong getLastModified() - Returns:
- File.lastModified().
 
 - 
getLastModifiedHttpjava.lang.String getLastModifiedHttp() - Returns:
- the last modified time of this resource in the correct format for the HTTP Last-Modified header as specified by RFC 2616.
 
 - 
existsboolean exists() - Returns:
- File.exists().
 
 - 
isVirtualboolean isVirtual() Indicates if this resource is required for applications to correctly scan the file structure but that does not exist in either the main or any additionalWebResourceSet. For example, if an external directory is mapped to /WEB-INF/lib in an otherwise empty web application, /WEB-INF will be represented as a virtual resource.- Returns:
- truefor a virtual resource
 
 - 
isDirectoryboolean isDirectory() - Returns:
- File.isDirectory().
 
 - 
isFileboolean isFile() - Returns:
- File.isFile().
 
 - 
deleteboolean delete() - Returns:
- File.delete().
 
 - 
getNamejava.lang.String getName() - Returns:
- File.getName().
 
 - 
getContentLengthlong getContentLength() - Returns:
- File.length().
 
 - 
getCanonicalPathjava.lang.String getCanonicalPath() - Returns:
- File.getCanonicalPath().
 
 - 
canReadboolean canRead() - Returns:
- File.canRead().
 
 - 
getWebappPathjava.lang.String getWebappPath() - Returns:
- The path of this resource relative to the web application root. If the resource is a directory, the return value will end in '/'.
 
 - 
getETagjava.lang.String getETag() Return the strong ETag if available (currently not supported) else return the weak ETag calculated from the content length and last modified.- Returns:
- The ETag for this resource
 
 - 
setMimeTypevoid setMimeType(java.lang.String mimeType) Set the MIME type for this Resource.- Parameters:
- mimeType- The mime type that will be associated with the resource
 
 - 
getMimeTypejava.lang.String getMimeType() - Returns:
- the MIME type for this Resource.
 
 - 
getInputStreamjava.io.InputStream getInputStream() Obtain an InputStream based on the contents of this resource.- Returns:
- An InputStream based on the contents of this resource or
          nullif the resource does not exist or does not represent a file
 
 - 
getContentbyte[] getContent() - Returns:
- the binary content of this resource or nullif it is not available in a byte[] because, for example, it is too big.
 
 - 
getCreationlong getCreation() - Returns:
- The time the file was created. If not available, the result of
 getLastModified()will be returned.
 
 - 
getURLjava.net.URL getURL() - Returns:
- a URL to access the resource or nullif no such URL is available or if the resource does not exist.
 
 - 
getCodeBasejava.net.URL getCodeBase() - Returns:
- the code base for this resource that will be used when looking up the assigned permissions for the code base in the security policy file when running under a security manager.
 
 - 
getWebResourceRootWebResourceRoot getWebResourceRoot() - Returns:
- a reference to the WebResourceRoot of which this WebResource is a part.
 
 - 
getCertificatesjava.security.cert.Certificate[] getCertificates() - Returns:
- the certificates that were used to sign this resource to verify it or @null if none.
- See Also:
- JarEntry.getCertificates()
 
 - 
getManifestjava.util.jar.Manifest getManifest() - Returns:
- the manifest associated with this resource or @null if none.
- See Also:
- JarFile.getManifest()
 
 
- 
 
-