public class GZipCompressionDataHandler extends DataHandler
Modifier and Type | Field and Description |
---|---|
static String |
GZIP_COMPRESSION |
Constructor and Description |
---|
GZipCompressionDataHandler(DataSource ds)
Constructor which takes a datasource.
|
GZipCompressionDataHandler(DataSource ds,
String contentType)
Constructor which takes data source and content type.
|
Modifier and Type | Method and Description |
---|---|
String |
getContentType()
Overridden method to return content type.
|
InputStream |
getInputStream()
Overridden method to get input stream, this method will differentiate returning input stream depending on the
content type of the data handler.
|
void |
writeTo(OutputStream out)
Overridden method to write compressed data or uncompressed data depending on the content type.
|
getAllCommands, getBean, getCommand, getContent, getDataSource, getName, getOutputStream, getPreferredCommands, getTransferData, getTransferDataFlavors, isDataFlavorSupported, setCommandMap, setDataContentHandlerFactory
public static String GZIP_COMPRESSION
public GZipCompressionDataHandler(DataSource ds)
ds
- DataSource
objectpublic GZipCompressionDataHandler(DataSource ds, String contentType)
ds
- DataSource
objectcontentType
- content typepublic InputStream getInputStream() throws IOException
getInputStream
in class DataHandler
IOException
public void writeTo(OutputStream out) throws IOException
writeTo
in class DataHandler
out
- OutputStream
objectIOException
public String getContentType()
getContentType
in class DataHandler
Copyright © 2017 WSO2. All rights reserved.