|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.plugin.webresource.transformer.AbstractTransformedDownloadableResource
com.atlassian.plugin.webresource.transformer.AbstractStringTransformedDownloadableResource
CharSequenceDownloadableResource instead
@Deprecated public abstract class AbstractStringTransformedDownloadableResource
Abstract class that makes it easy to create transforms that go from string to string. Override
getEncoding() to customize the character encoding of the underlying content and transformed content.
For example, here is a minimal transformer that prepends text to the underlying resource:
public class PrefixTransformer implements WebResourceTransformer
{
public DownloadableResource transform(Element configElement, ResourceLocation location, String filePath, DownloadableResource nextResource)
{
return new AbstractStringTransformedDownloadableResource(nextResource)
{
protected String transform(String originalContent)
{
return "Prefix: " + originalContent;
}
};
}
}
| Constructor Summary | |
|---|---|
AbstractStringTransformedDownloadableResource(DownloadableResource originalResource)
Deprecated. |
|
| Method Summary | |
|---|---|
protected String |
getEncoding()
Deprecated. |
void |
streamResource(OutputStream out)
Deprecated. Write the resource to the supplied OutputStream. |
protected abstract String |
transform(String originalContent)
Deprecated. Override this method to transform the original content into a new format. |
| Methods inherited from class com.atlassian.plugin.webresource.transformer.AbstractTransformedDownloadableResource |
|---|
getContentType, getOriginalResource, isResourceModified, serveResource |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractStringTransformedDownloadableResource(DownloadableResource originalResource)
| Method Detail |
|---|
public void streamResource(OutputStream out)
throws DownloadException
DownloadableResource
out - the stream to write to
DownloadException - if there were errors writing to the response. Since 2.3.protected String getEncoding()
protected abstract String transform(String originalContent)
originalContent - The original content from the original downloadable resource.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||