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() |
protected abstract Log |
getLog() |
String |
getMimeType() |
String |
getWebappPath() |
WebResourceRoot |
getWebResourceRoot() |
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()
getWebResourceRoot
in interface WebResource
public final String getWebappPath()
getWebappPath
in interface WebResource
public final String getLastModifiedHttp()
getLastModifiedHttp
in interface WebResource
public final String getETag()
WebResource
getETag
in interface WebResource
public final void setMimeType(String mimeType)
WebResource
setMimeType
in interface WebResource
mimeType
- The mime type that will be associated with the resourcepublic final String getMimeType()
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-2020 Apache Software Foundation. All Rights Reserved.