Package org.apache.catalina.webresources
Class AbstractResource
- java.lang.Object
-
- org.apache.catalina.webresources.AbstractResource
-
- All Implemented Interfaces:
WebResource
- Direct Known Subclasses:
AbstractArchiveResource,FileResource,JarResourceRoot
public abstract class AbstractResource extends java.lang.Object implements WebResource
AbstractWebResourceimplementation that provides common functionality for all web resource implementations.
-
-
Field Summary
Fields Modifier and Type Field Description protected static StringManagersmThe string manager for this class.
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractResource(WebResourceRoot root, java.lang.String webAppPath)Constructs a new AbstractResource.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract java.io.InputStreamdoGetInputStream()Returns the input stream for this resource.java.lang.StringgetETag()Gets the weak ETag for this resource.java.io.InputStreamgetInputStream()Gets the input stream for this resource.java.lang.StringgetLastModifiedHttp()Gets the last modified date as an HTTP date string.protected abstract LoggetLog()Gets the logger for this resource.java.lang.StringgetMimeType()Gets the MIME type for this resource.java.lang.StringgetStrongETag()Gets the strong ETag for this resource.java.lang.StringgetWebappPath()Gets the web app path.WebResourceRootgetWebResourceRoot()Gets the web resource root.voidsetMimeType(java.lang.String mimeType)Sets 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 Detail
-
sm
protected static final StringManager sm
The string manager for this class.
-
-
Constructor Detail
-
AbstractResource
protected AbstractResource(WebResourceRoot root, java.lang.String webAppPath)
Constructs a new AbstractResource.- Parameters:
root- The rootwebAppPath- The web app path
-
-
Method Detail
-
getWebResourceRoot
public final WebResourceRoot getWebResourceRoot()
Gets the web resource root.- Specified by:
getWebResourceRootin interfaceWebResource- Returns:
- The web resource root
-
getWebappPath
public final java.lang.String getWebappPath()
Gets the web app path.- Specified by:
getWebappPathin interfaceWebResource- Returns:
- The web app path
-
getLastModifiedHttp
public final java.lang.String getLastModifiedHttp()
Gets the last modified date as an HTTP date string.- Specified by:
getLastModifiedHttpin interfaceWebResource- Returns:
- The last modified date as an HTTP date string
-
getETag
public final java.lang.String getETag()
Gets the weak ETag for this resource.- Specified by:
getETagin interfaceWebResource- Returns:
- The weak ETag
-
getStrongETag
public final java.lang.String getStrongETag()
Gets the strong ETag for this resource.- Specified by:
getStrongETagin interfaceWebResource- Returns:
- The strong ETag
-
setMimeType
public final void setMimeType(java.lang.String mimeType)
Sets the MIME type for this resource.- Specified by:
setMimeTypein interfaceWebResource- Parameters:
mimeType- The MIME type
-
getMimeType
public final java.lang.String getMimeType()
Gets the MIME type for this resource.- Specified by:
getMimeTypein interfaceWebResource- Returns:
- The MIME type
-
getInputStream
public final java.io.InputStream getInputStream()
Gets the input stream for this resource.- Specified by:
getInputStreamin interfaceWebResource- Returns:
- the input stream for this resource
-
doGetInputStream
protected abstract java.io.InputStream doGetInputStream()
Returns the input stream for this resource.- Returns:
- the input stream for this resource
-
getLog
protected abstract Log getLog()
Gets the logger for this resource.- Returns:
- the logger
-
-