com.atlassian.plugin.webresource.transformer
Class TransformerUtils

java.lang.Object
  extended by com.atlassian.plugin.webresource.transformer.TransformerUtils

public class TransformerUtils
extends Object

Utility class for transforming resources


Field Summary
static Charset UTF8
           
 
Constructor Summary
TransformerUtils()
           
 
Method Summary
static void transformAndStreamResource(DownloadableResource originalResource, Charset encoding, OutputStream out, com.google.common.base.Function<CharSequence,CharSequence> transform)
          Write apply a given transform a resource and then write the transformed content to the supplied OutputStream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UTF8

public static final Charset UTF8
Constructor Detail

TransformerUtils

public TransformerUtils()
Method Detail

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 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
Since:
2.9.0


Copyright © 2011 Atlassian. All Rights Reserved.