Class TransformerUtils
java.lang.Object
com.atlassian.plugin.webresource.transformer.TransformerUtils
Utility class for transforming resources
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidtransformAndStreamResource(com.atlassian.plugin.servlet.DownloadableResource originalResource, Charset encoding, OutputStream outputStream, Function<CharSequence, CharSequence> transform) Write apply a given transform a resource and then write the transformed content to the supplied OutputStream.
-
Field Details
-
UTF8
-
-
Constructor Details
-
TransformerUtils
public TransformerUtils()
-
-
Method Details
-
transformAndStreamResource
public static void transformAndStreamResource(com.atlassian.plugin.servlet.DownloadableResource originalResource, Charset encoding, OutputStream outputStream, Function<CharSequence, CharSequence> transform) throws com.atlassian.plugin.servlet.DownloadExceptionWrite 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 writingoutputStream- - the output streamtransform- - a function for transforming the content- Throws:
com.atlassian.plugin.servlet.DownloadException- - thrown if it is not possible to stream the output- Since:
- 2.9.0
-