Class XzResource
java.lang.Object
- All Implemented Interfaces:
java.lang.Cloneable
,java.lang.Comparable<Resource>
,java.lang.Iterable<Resource>
,ResourceCollection
public class XzResource extends CompressedResource
A XZ compressed resource.
Wraps around another resource, delegates all queries to that other resource but uncompresses/compresses streams on the fly.
- Since:
- Ant 1.10.1
-
Field Summary
Fields inherited from class org.apache.tools.ant.types.Resource
MAGIC, UNKNOWN_DATETIME, UNKNOWN_SIZE
-
Constructor Summary
Constructors Constructor Description XzResource()
A no-arg constructorXzResource(ResourceCollection other)
Constructor with another resource to wrap. -
Method Summary
Modifier and Type Method Description protected java.lang.String
getCompressionName()
Get the name of the compression method.protected java.io.InputStream
wrapStream(java.io.InputStream in)
Decompress on the fly using java.util.zip.XZInputStream.protected java.io.OutputStream
wrapStream(java.io.OutputStream out)
Compress on the fly using java.util.zip.XZOutStream.Methods inherited from class org.apache.tools.ant.types.resources.ContentTransformingResource
as, getInputStream, getOutputStream, getSize, isAppendSupported
Methods inherited from class org.apache.tools.ant.types.resources.ResourceDecorator
addConfigured, compareTo, dieOnCircularReference, getLastModified, getName, getResource, hashCode, isDirectory, isExists, isFilesystemOnly, setDirectory, setExists, setLastModified, setName, setRefid, setSize
Methods inherited from class org.apache.tools.ant.types.Resource
asOptional, clone, equals, getMagicNumber, getRef, iterator, size, toLongString
Methods inherited from class org.apache.tools.ant.types.DataType
checkAttributesAllowed, 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.ProjectComponent
getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject
-
Constructor Details
-
XzResource
public XzResource()A no-arg constructor -
XzResource
Constructor with another resource to wrap.- Parameters:
other
- the resource to wrap.
-
-
Method Details
-
wrapStream
protected java.io.InputStream wrapStream(java.io.InputStream in) throws java.io.IOExceptionDecompress on the fly using java.util.zip.XZInputStream.- Specified by:
wrapStream
in classContentTransformingResource
- Parameters:
in
- the stream to wrap.- Returns:
- the wrapped stream.
- Throws:
java.io.IOException
- if there is a problem.
-
wrapStream
protected java.io.OutputStream wrapStream(java.io.OutputStream out) throws java.io.IOExceptionCompress on the fly using java.util.zip.XZOutStream.- Specified by:
wrapStream
in classContentTransformingResource
- Parameters:
out
- the stream to wrap.- Returns:
- the wrapped stream.
- Throws:
java.io.IOException
- if there is a problem.
-
getCompressionName
protected java.lang.String getCompressionName()Get the name of the compression method.- Specified by:
getCompressionName
in classCompressedResource
- Returns:
- the string "XZ".
-