public abstract class AbstractResource extends java.lang.Object implements WebResource
Modifier and Type | Field and Description |
---|---|
protected static StringManager |
sm |
Modifier | Constructor and Description |
---|---|
protected |
AbstractResource(WebResourceRoot root,
java.lang.String webAppPath) |
Modifier and Type | Method and Description |
---|---|
protected abstract java.io.InputStream |
doGetInputStream() |
java.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.
|
java.io.InputStream |
getInputStream()
Obtain an InputStream based on the contents of this resource.
|
java.lang.String |
getLastModifiedHttp()
Return the last modified time of this resource in the correct format for
the HTTP Last-Modified header as specified by RFC 2616.
|
protected abstract Log |
getLog() |
java.lang.String |
getMimeType()
Get the MIME type for this Resource.
|
java.lang.String |
getWebappPath()
The path of this resource relative to the web application root.
|
WebResourceRoot |
getWebResourceRoot()
Obtain a reference to the WebResourceRoot of which this WebResource is a
part.
|
void |
setMimeType(java.lang.String mimeType)
Set the MIME type for this Resource.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
canRead, delete, exists, getCanonicalPath, getCertificates, getCodeBase, getContent, getContentLength, getCreation, getLastModified, getManifest, getName, getURL, isDirectory, isFile, isVirtual
protected static final StringManager sm
protected AbstractResource(WebResourceRoot root, java.lang.String webAppPath)
public final WebResourceRoot getWebResourceRoot()
WebResource
getWebResourceRoot
in interface WebResource
public final java.lang.String getWebappPath()
WebResource
getWebappPath
in interface WebResource
public final java.lang.String getLastModifiedHttp()
WebResource
getLastModifiedHttp
in interface WebResource
public final java.lang.String getETag()
WebResource
getETag
in interface WebResource
public final void setMimeType(java.lang.String mimeType)
WebResource
setMimeType
in interface WebResource
public final java.lang.String getMimeType()
WebResource
getMimeType
in interface WebResource
public final java.io.InputStream getInputStream()
WebResource
getInputStream
in interface WebResource
null
if the resource does not exist or does not
represent a fileprotected abstract java.io.InputStream doGetInputStream()
protected abstract Log getLog()
Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.