com.twitter.common.net.http.handlers
Class AssetHandler.StaticAsset

java.lang.Object
  extended by com.twitter.common.net.http.handlers.AssetHandler.StaticAsset
Enclosing class:
AssetHandler

public static class AssetHandler.StaticAsset
extends Object


Constructor Summary
AssetHandler.StaticAsset(InputSupplier<? extends InputStream> inputSupplier, String contentType, boolean cacheLocally)
          Creates a new static asset.
 
Method Summary
 String getChecksum()
           
 String getContentType()
           
 byte[] getGzipData()
           
 byte[] getRawData()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AssetHandler.StaticAsset

public AssetHandler.StaticAsset(InputSupplier<? extends InputStream> inputSupplier,
                                String contentType,
                                boolean cacheLocally)
Creates a new static asset.

Parameters:
inputSupplier - Supplier of the input stream from which to load the asset.
contentType - HTTP content type of the asset.
cacheLocally - If true the asset will be loaded once and stored in memory, if false it will be loaded on each request.
Method Detail

getContentType

public String getContentType()

getRawData

public byte[] getRawData()
                  throws IOException
Throws:
IOException

getGzipData

public byte[] getGzipData()
                   throws IOException
Throws:
IOException

getChecksum

public String getChecksum()
                   throws IOException
Throws:
IOException