Class AbstractResource
java.lang.Object
org.apache.catalina.webresources.AbstractResource
- All Implemented Interfaces:
WebResource
- Direct Known Subclasses:
AbstractArchiveResource
,FileResource
,JarResourceRoot
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractResource
(WebResourceRoot root, String webAppPath) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract InputStream
final String
getETag()
Return the weak ETag calculated from the content length and last modified.final InputStream
Obtain an InputStream based on the contents of this resource.final String
protected abstract Log
getLog()
final String
final String
Return the strong ETag if available else return the weak ETag calculated from the content length and last modified.final String
final WebResourceRoot
final void
setMimeType
(String mimeType) Set the MIME type for this Resource.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.catalina.WebResource
canRead, delete, exists, getCanonicalPath, getCertificates, getCodeBase, getContent, getContentLength, getCreation, getLastModified, getManifest, getName, getURL, isDirectory, isFile, isVirtual
-
Field Details
-
sm
-
-
Constructor Details
-
AbstractResource
-
-
Method Details
-
getWebResourceRoot
- Specified by:
getWebResourceRoot
in interfaceWebResource
- Returns:
- a reference to the WebResourceRoot of which this WebResource is a part.
-
getWebappPath
- Specified by:
getWebappPath
in interfaceWebResource
- Returns:
- The path of this resource relative to the web application root. If the resource is a directory, the return value will end in '/'.
-
getLastModifiedHttp
- Specified by:
getLastModifiedHttp
in interfaceWebResource
- Returns:
- the last modified time of this resource in the correct format for the HTTP Last-Modified header as specified by RFC 2616.
-
getETag
Description copied from interface:WebResource
Return the weak ETag calculated from the content length and last modified.- Specified by:
getETag
in interfaceWebResource
- Returns:
- The ETag for this resource
-
getStrongETag
Description copied from interface:WebResource
Return the strong ETag if available else return the weak ETag calculated from the content length and last modified.- Specified by:
getStrongETag
in interfaceWebResource
- Returns:
- The ETag for this resource
-
setMimeType
Description copied from interface:WebResource
Set the MIME type for this Resource.- Specified by:
setMimeType
in interfaceWebResource
- Parameters:
mimeType
- The mime type that will be associated with the resource
-
getMimeType
- Specified by:
getMimeType
in interfaceWebResource
- Returns:
- the MIME type for this Resource.
-
getInputStream
Description copied from interface:WebResource
Obtain an InputStream based on the contents of this resource.- Specified by:
getInputStream
in interfaceWebResource
- Returns:
- An InputStream based on the contents of this resource or
null
if the resource does not exist or does not represent a file
-
doGetInputStream
-
getLog
-