public class

TransformerUtils

extends Object
java.lang.Object
   ↳ com.atlassian.plugin.webresource.transformer.TransformerUtils

Class Overview

Utility class for transforming resources

Summary

Fields
public static final Charset UTF8
Public Constructors
TransformerUtils()
Public Methods
static void transformAndStreamResource(DownloadableResource originalResource, Charset encoding, OutputStream out, Function<CharSequenceCharSequence> transform)
Write apply a given transform a resource and then write the transformed content to the supplied OutputStream.
[Expand]
Inherited Methods
From class java.lang.Object

Fields

public static final Charset UTF8

Public Constructors

public TransformerUtils ()

Public Methods

public static void transformAndStreamResource (DownloadableResource originalResource, Charset encoding, OutputStream out, Function<CharSequenceCharSequence> transform)

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 transform
encoding - the encoding to use for writing
out - the output stream
transform - a function for transforming the content
Throws
DownloadException - thrown if it is not possible to stream the output