Class GZipResource
- java.lang.Object
- 
- All Implemented Interfaces:
- java.lang.Cloneable,- java.lang.Comparable<Resource>,- java.lang.Iterable<Resource>,- ResourceCollection
 
 public class GZipResource extends CompressedResource 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
 
- 
- 
Field Summary- 
Fields inherited from class org.apache.tools.ant.types.ResourceMAGIC, UNKNOWN_DATETIME, UNKNOWN_SIZE
 - 
Fields inherited from class org.apache.tools.ant.ProjectComponentdescription, location, project
 
- 
 - 
Constructor SummaryConstructors Constructor Description GZipResource()A no-arg constructorGZipResource(ResourceCollection other)Constructor with another resource to wrap.
 - 
Method SummaryModifier and Type Method Description protected java.lang.StringgetCompressionName()Get the name of the compression method.protected java.io.InputStreamwrapStream(java.io.InputStream in)Decompress on the fly using java.util.zip.GZIPInputStream.protected java.io.OutputStreamwrapStream(java.io.OutputStream out)Compress on the fly using java.util.zip.GZIPOutStream.- 
Methods inherited from class org.apache.tools.ant.types.resources.CompressedResourcetoString
 - 
Methods inherited from class org.apache.tools.ant.types.resources.ContentTransformingResourceas, getInputStream, getOutputStream, getSize, isAppendSupported
 - 
Methods inherited from class org.apache.tools.ant.types.resources.ResourceDecoratoraddConfigured, compareTo, dieOnCircularReference, getLastModified, getName, getResource, hashCode, isDirectory, isExists, isFilesystemOnly, setDirectory, setExists, setLastModified, setName, setRefid, setSize
 - 
Methods inherited from class org.apache.tools.ant.types.ResourceasOptional, clone, equals, getMagicNumber, getRef, iterator, size, toLongString
 - 
Methods inherited from class org.apache.tools.ant.types.DataTypecheckAttributesAllowed, checkChildrenAllowed, circularReference, dieOnCircularReference, dieOnCircularReference, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getDataTypeName, getRefid, invokeCircularReferenceCheck, isChecked, isReference, noChildrenAllowed, pushAndInvokeCircularReferenceCheck, setChecked, tooManyAttributes
 - 
Methods inherited from class org.apache.tools.ant.ProjectComponentgetDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject
 - 
Methods inherited from class java.lang.Objectfinalize, getClass, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface org.apache.tools.ant.types.ResourceCollectionisEmpty, stream
 
- 
 
- 
- 
- 
Constructor Detail- 
GZipResourcepublic GZipResource() A no-arg constructor
 - 
GZipResourcepublic GZipResource(ResourceCollection other) Constructor with another resource to wrap.- Parameters:
- other- the resource to wrap.
 
 
- 
 - 
Method Detail- 
wrapStreamprotected java.io.InputStream wrapStream(java.io.InputStream in) throws java.io.IOExceptionDecompress on the fly using java.util.zip.GZIPInputStream.- Specified by:
- wrapStreamin class- ContentTransformingResource
- Parameters:
- in- the stream to wrap.
- Returns:
- the wrapped stream.
- Throws:
- java.io.IOException- if there is a problem.
 
 - 
wrapStreamprotected java.io.OutputStream wrapStream(java.io.OutputStream out) throws java.io.IOExceptionCompress on the fly using java.util.zip.GZIPOutStream.- Specified by:
- wrapStreamin class- ContentTransformingResource
- Parameters:
- out- the stream to wrap.
- Returns:
- the wrapped stream.
- Throws:
- java.io.IOException- if there is a problem.
 
 - 
getCompressionNameprotected java.lang.String getCompressionName() Get the name of the compression method.- Specified by:
- getCompressionNamein class- CompressedResource
- Returns:
- the string "GZip".
 
 
- 
 
-