org.apache.tools.ant.types.resources

Class GZipResource

public class GZipResource extends CompressedResource

A GZip compressed resource.

Wraps around another resource, delegates all quries to that other resource but uncompresses/compresses streams on the fly.

Since: Ant 1.7

Constructor Summary
GZipResource()
A no-arg constructor
GZipResource(ResourceCollection other)
Constructor with another resource to wrap.
Method Summary
protected StringgetCompressionName()
Get the name of the compression method.
protected InputStreamwrapStream(InputStream in)
Decompress on the fly using java.util.zip.GZIPInputStream.
protected OutputStreamwrapStream(OutputStream out)
Compress on the fly using java.util.zip.GZIPOutStream.

Constructor Detail

GZipResource

public GZipResource()
A no-arg constructor

GZipResource

public GZipResource(ResourceCollection other)
Constructor with another resource to wrap.

Parameters: other the resource to wrap.

Method Detail

getCompressionName

protected String getCompressionName()
Get the name of the compression method.

Returns: the string "GZip".

wrapStream

protected InputStream wrapStream(InputStream in)
Decompress on the fly using java.util.zip.GZIPInputStream.

Parameters: in the stream to wrap.

Returns: the wrapped stream.

Throws: IOException if there is a problem.

wrapStream

protected OutputStream wrapStream(OutputStream out)
Compress on the fly using java.util.zip.GZIPOutStream.

Parameters: out the stream to wrap.

Returns: the wrapped stream.

Throws: IOException if there is a problem.