public abstract class AbstractResource extends Object implements WebResource
Modifier and Type | Field and Description |
---|---|
protected static StringManager |
sm |
Modifier | Constructor and Description |
---|---|
protected |
AbstractResource(WebResourceRoot root,
String webAppPath) |
Modifier and Type | Method and Description |
---|---|
protected abstract InputStream |
doGetInputStream() |
String |
getETag()
Return the strong ETag if available (currently not supported) else return
the weak ETag calculated from the content length and last modified.
|
InputStream |
getInputStream()
Obtain an InputStream based on the contents of this resource.
|
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() |
String |
getMimeType()
Get the MIME type for this Resource.
|
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(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, String webAppPath)
public final WebResourceRoot getWebResourceRoot()
WebResource
getWebResourceRoot
in interface WebResource
public final String getWebappPath()
WebResource
getWebappPath
in interface WebResource
public final String getLastModifiedHttp()
WebResource
getLastModifiedHttp
in interface WebResource
public final String getETag()
WebResource
getETag
in interface WebResource
public final void setMimeType(String mimeType)
WebResource
setMimeType
in interface WebResource
public final String getMimeType()
WebResource
getMimeType
in interface WebResource
public final InputStream getInputStream()
WebResource
getInputStream
in interface WebResource
null
if the resource does not exist or does not
represent a fileprotected abstract InputStream doGetInputStream()
protected abstract Log getLog()
Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.