Package org.pentaho.di.core.compress
Interface CompressionProvider
-
- All Known Implementing Classes:
GZIPCompressionProvider
,HadoopSnappyCompressionProvider
,NoneCompressionProvider
,SnappyCompressionProvider
,ZIPCompressionProvider
public interface CompressionProvider
The CompressionProvider interface specifies the operations needed to interact with a stream whose data is compressed on output and decompressed on input.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CompressionInputStream
createInputStream(InputStream in)
Creates an input stream that decompresses data (according to the provider's implementation)CompressionOutputStream
createOutputStream(OutputStream out)
Creates an output stream that compresses data (according to the provider's implementation)String
getDefaultExtension()
Gets the default file extension for this provider.String
getDescription()
Gets the name of this provider.String
getName()
Gets the name of this provider.boolean
supportsInput()
Whether this compression provider supports input streamsboolean
supportsOutput()
Whether this compression provider supports output streams
-
-
-
Method Detail
-
createInputStream
CompressionInputStream createInputStream(InputStream in) throws IOException
Creates an input stream that decompresses data (according to the provider's implementation)- Parameters:
in
- An existing input stream to wrap- Returns:
- a CompressionInputStream object that decompresses incoming data
- Throws:
IOException
-
supportsInput
boolean supportsInput()
Whether this compression provider supports input streams- Returns:
- true if the provider supports input streams, false otherwise
-
createOutputStream
CompressionOutputStream createOutputStream(OutputStream out) throws IOException
Creates an output stream that compresses data (according to the provider's implementation)- Parameters:
out
- An existing output stream to wrap- Returns:
- a CompressionOutputStream object that compresses outgoing data
- Throws:
IOException
-
supportsOutput
boolean supportsOutput()
Whether this compression provider supports output streams- Returns:
- true if the provider supports output streams, false otherwise
-
getName
String getName()
Gets the name of this provider. Used for display and as a reference in saved artifacts (transformations, e.g.)- Returns:
- A String containing the name of this provider
-
getDescription
String getDescription()
Gets the name of this provider. Used for display e.g.- Returns:
- A String containing a description of this provider
-
getDefaultExtension
String getDefaultExtension()
Gets the default file extension for this provider. If the streams are wrapped in File streams, this method can be used to determine an appropriate extension to append to the filename so the file will be recognized as an artifact of the compression mechanism (.zip, .bz2, e.g.)- Returns:
- A String containing the default file extension for this provider
-
-