com.atlassian.plugin.webresource.transformer
Class AbstractTransformedDownloadableResource
java.lang.Object
com.atlassian.plugin.webresource.transformer.AbstractTransformedDownloadableResource
- All Implemented Interfaces:
- DownloadableResource
- Direct Known Subclasses:
- AbstractStringTransformedDownloadableResource, CharSequenceDownloadableResource
public abstract class AbstractTransformedDownloadableResource
- extends Object
- implements DownloadableResource
Abstract class for implementing downloadable resources that are wrapping an underlying resource as part of a
WebResourceTransformer implementation. Subclasses are expected to implement DownloadableResource.streamResource(OutputStream),
while the other methods are delegated by default.
- Since:
- 2.5.0
|
Method Summary |
String |
getContentType()
Returns the content type for the resource. |
protected DownloadableResource |
getOriginalResource()
|
boolean |
isResourceModified(javax.servlet.http.HttpServletRequest httpServletRequest,
javax.servlet.http.HttpServletResponse httpServletResponse)
Returns true if the plugin resource has been modified. |
void |
serveResource(javax.servlet.http.HttpServletRequest httpServletRequest,
javax.servlet.http.HttpServletResponse response)
Writes the resource content out into the response. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractTransformedDownloadableResource
public AbstractTransformedDownloadableResource(DownloadableResource originalResource)
isResourceModified
public boolean isResourceModified(javax.servlet.http.HttpServletRequest httpServletRequest,
javax.servlet.http.HttpServletResponse httpServletResponse)
- Description copied from interface:
DownloadableResource
- Returns true if the plugin resource has been modified. The implementing class is responsible for
setting any appropriate response codes or headers on the response.
If the resource has been modified, the resource shouldn't be served.
- Specified by:
isResourceModified in interface DownloadableResource
serveResource
public void serveResource(javax.servlet.http.HttpServletRequest httpServletRequest,
javax.servlet.http.HttpServletResponse response)
throws DownloadException
- Description copied from interface:
DownloadableResource
- Writes the resource content out into the response.
- Specified by:
serveResource in interface DownloadableResource
- Throws:
DownloadException - if there were errors writing to the response.
getContentType
public String getContentType()
- Description copied from interface:
DownloadableResource
- Returns the content type for the resource. May return null if it cannot resolve its own content type.
- Specified by:
getContentType in interface DownloadableResource
getOriginalResource
protected DownloadableResource getOriginalResource()
Copyright © 2011 Atlassian. All Rights Reserved.