com.atlassian.plugin.webresource.transformer
Class TransformerUtils
java.lang.Object
com.atlassian.plugin.webresource.transformer.TransformerUtils
public class TransformerUtils
- extends Object
Utility class for transforming resources
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UTF8
public static final Charset UTF8
TransformerUtils
public TransformerUtils()
transformAndStreamResource
public static void transformAndStreamResource(DownloadableResource originalResource,
Charset encoding,
OutputStream out,
com.google.common.base.Function<CharSequence,CharSequence> transform)
throws DownloadException
- Write apply a given transform a resource and then write the transformed content
to the supplied OutputStream.
Note that the OutputStream will not be closed by this method.
- Parameters:
originalResource - - the resource to transformencoding - - the encoding to use for writingout - - the output streamtransform - - a function for transforming the content
- Throws:
DownloadException - - thrown if it is not possible to stream the output- Since:
- 2.9.0
Copyright © 2013 Atlassian. All Rights Reserved.