Top Description Constructors Methods
org.apache.tools.ant.types.resources

public Class GZipResource

extends CompressedResource
Class Inheritance
Imports
java.io.IOException, .InputStream, .OutputStream, java.util.zip.GZIPInputStream, .GZIPOutputStream, org.apache.tools.ant.types.ResourceCollection

A GZip compressed resource.

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

Since
Ant 1.7

Constructor Summary

AccessConstructor and Description
public
GZipResource()

A no-arg constructor

public
GZipResource(ResourceCollection
the resource to wrap.
other
)

Constructor with another resource to wrap.

Method Summary

Modifier and TypeMethod and Description
protected String

Returns:

the string "GZip".
getCompressionName
()

Implements abstract org.apache.tools.ant.types.resources.CompressedResource.getCompressionName.

Get the name of the compression method.
protected InputStream

Returns:

the wrapped stream.
wrapStream
(InputStream
the stream to wrap.
in
)

Implements abstract org.apache.tools.ant.types.resources.ContentTransformingResource.wrapStream.

Decompress on the fly using java.util.zip.GZIPInputStream.
protected OutputStream

Returns:

the wrapped stream.
wrapStream
(OutputStream
the stream to wrap.
out
)

Implements abstract org.apache.tools.ant.types.resources.ContentTransformingResource.wrapStream.

Compress on the fly using java.util.zip.GZIPOutStream.
Inherited from org.apache.tools.ant.types.resources.CompressedResource:
toString

Constructor Detail

GZipResourceback to summary
public GZipResource()

A no-arg constructor

GZipResourceback to summary
public GZipResource(ResourceCollection other)

Constructor with another resource to wrap.

Parameters
other:ResourceCollection

the resource to wrap.

Method Detail

getCompressionNameback to summary
protected String getCompressionName()

Implements abstract org.apache.tools.ant.types.resources.CompressedResource.getCompressionName.

Get the name of the compression method.

Returns:String

the string "GZip".

Annotations
@Override
wrapStreamback to summary
protected InputStream wrapStream(InputStream in) throws IOException

Implements abstract org.apache.tools.ant.types.resources.ContentTransformingResource.wrapStream.

Decompress on the fly using java.util.zip.GZIPInputStream.

Parameters
in:InputStream

the stream to wrap.

Returns:InputStream

the wrapped stream.

Annotations
@Override
Exceptions
IOException:
if there is a problem.
wrapStreamback to summary
protected OutputStream wrapStream(OutputStream out) throws IOException

Implements abstract org.apache.tools.ant.types.resources.ContentTransformingResource.wrapStream.

Compress on the fly using java.util.zip.GZIPOutStream.

Parameters
out:OutputStream

the stream to wrap.

Returns:OutputStream

the wrapped stream.

Annotations
@Override
Exceptions
IOException:
if there is a problem.