Package org.apache.catalina.webresources
Class EmptyResource
- java.lang.Object
- 
- org.apache.catalina.webresources.EmptyResource
 
- 
- All Implemented Interfaces:
- WebResource
 - Direct Known Subclasses:
- VirtualResource
 
 public class EmptyResource extends java.lang.Object implements WebResource 
- 
- 
Constructor SummaryConstructors Constructor Description EmptyResource(WebResourceRoot root, java.lang.String webAppPath)EmptyResource(WebResourceRoot root, java.lang.String webAppPath, java.io.File file)
 - 
Method SummaryAll Methods Instance Methods Concrete 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.
 
- 
- 
- 
Constructor Detail- 
EmptyResourcepublic EmptyResource(WebResourceRoot root, java.lang.String webAppPath) 
 - 
EmptyResourcepublic EmptyResource(WebResourceRoot root, java.lang.String webAppPath, java.io.File file) 
 
- 
 - 
Method Detail- 
getLastModifiedpublic long getLastModified() - Specified by:
- getLastModifiedin interface- WebResource
- Returns:
- File.lastModified().
 
 - 
getLastModifiedHttppublic java.lang.String getLastModifiedHttp() - Specified by:
- getLastModifiedHttpin interface- WebResource
- Returns:
- the last modified time of this resource in the correct format for the HTTP Last-Modified header as specified by RFC 2616.
 
 - 
existspublic boolean exists() - Specified by:
- existsin interface- WebResource
- Returns:
- File.exists().
 
 - 
isVirtualpublic boolean isVirtual() Description copied from interface:WebResourceIndicates 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.- Specified by:
- isVirtualin interface- WebResource
- Returns:
- truefor a virtual resource
 
 - 
isDirectorypublic boolean isDirectory() - Specified by:
- isDirectoryin interface- WebResource
- Returns:
- File.isDirectory().
 
 - 
isFilepublic boolean isFile() - Specified by:
- isFilein interface- WebResource
- Returns:
- File.isFile().
 
 - 
deletepublic boolean delete() - Specified by:
- deletein interface- WebResource
- Returns:
- File.delete().
 
 - 
getNamepublic java.lang.String getName() - Specified by:
- getNamein interface- WebResource
- Returns:
- File.getName().
 
 - 
getContentLengthpublic long getContentLength() - Specified by:
- getContentLengthin interface- WebResource
- Returns:
- File.length().
 
 - 
getCanonicalPathpublic java.lang.String getCanonicalPath() - Specified by:
- getCanonicalPathin interface- WebResource
- Returns:
- File.getCanonicalPath().
 
 - 
canReadpublic boolean canRead() - Specified by:
- canReadin interface- WebResource
- Returns:
- File.canRead().
 
 - 
getWebappPathpublic java.lang.String getWebappPath() - Specified by:
- getWebappPathin interface- WebResource
- Returns:
- The path of this resource relative to the web application root. If the resource is a directory, the return value will end in '/'.
 
 - 
getETagpublic java.lang.String getETag() Description copied from interface:WebResourceReturn the strong ETag if available (currently not supported) else return the weak ETag calculated from the content length and last modified.- Specified by:
- getETagin interface- WebResource
- Returns:
- The ETag for this resource
 
 - 
setMimeTypepublic void setMimeType(java.lang.String mimeType) Description copied from interface:WebResourceSet the MIME type for this Resource.- Specified by:
- setMimeTypein interface- WebResource
- Parameters:
- mimeType- The mime type that will be associated with the resource
 
 - 
getMimeTypepublic java.lang.String getMimeType() - Specified by:
- getMimeTypein interface- WebResource
- Returns:
- the MIME type for this Resource.
 
 - 
getInputStreampublic java.io.InputStream getInputStream() Description copied from interface:WebResourceObtain an InputStream based on the contents of this resource.- Specified by:
- getInputStreamin interface- WebResource
- Returns:
- An InputStream based on the contents of this resource or
          nullif the resource does not exist or does not represent a file
 
 - 
getContentpublic byte[] getContent() - Specified by:
- getContentin interface- WebResource
- Returns:
- the binary content of this resource or nullif it is not available in a byte[] because, for example, it is too big.
 
 - 
getCreationpublic long getCreation() - Specified by:
- getCreationin interface- WebResource
- Returns:
- The time the file was created. If not available, the result of
 WebResource.getLastModified()will be returned.
 
 - 
getURLpublic java.net.URL getURL() - Specified by:
- getURLin interface- WebResource
- Returns:
- a URL to access the resource or nullif no such URL is available or if the resource does not exist.
 
 - 
getCodeBasepublic java.net.URL getCodeBase() - Specified by:
- getCodeBasein interface- WebResource
- 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.
 
 - 
getCertificatespublic java.security.cert.Certificate[] getCertificates() - Specified by:
- getCertificatesin interface- WebResource
- Returns:
- the certificates that were used to sign this resource to verify it or @null if none.
- See Also:
- JarEntry.getCertificates()
 
 - 
getManifestpublic java.util.jar.Manifest getManifest() - Specified by:
- getManifestin interface- WebResource
- Returns:
- the manifest associated with this resource or @null if none.
- See Also:
- JarFile.getManifest()
 
 - 
getWebResourceRootpublic WebResourceRoot getWebResourceRoot() - Specified by:
- getWebResourceRootin interface- WebResource
- Returns:
- a reference to the WebResourceRoot of which this WebResource is a part.
 
 
- 
 
-