FileDocCategorySizeDatePackage
GZipResource.javaAPI DocApache Ant 1.702390Wed Dec 13 06:16:18 GMT 2006org.apache.tools.ant.types.resources

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

Fields Summary
Constructors Summary
public GZipResource()
A no-arg constructor

    
public GZipResource(org.apache.tools.ant.types.ResourceCollection other)
Constructor with another resource to wrap.

param
other the resource to wrap.

        super(other);
    
Methods Summary
protected java.lang.StringgetCompressionName()
Get the name of the compression method.

return
the string "GZip".

        return "GZip";
    
protected java.io.InputStreamwrapStream(java.io.InputStream in)
Decompress on the fly using java.util.zip.GZIPInputStream.

param
in the stream to wrap.
return
the wrapped stream.
throws
IOException if there is a problem.

        return new GZIPInputStream(in);
    
protected java.io.OutputStreamwrapStream(java.io.OutputStream out)
Compress on the fly using java.util.zip.GZIPOutStream.

param
out the stream to wrap.
return
the wrapped stream.
throws
IOException if there is a problem.

        return new GZIPOutputStream(out);