Class XzResource
- All Implemented Interfaces:
Cloneable,Comparable<Resource>,Iterable<Resource>,ResourceCollection
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_SIZEFields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project -
Constructor Summary
ConstructorsConstructorDescriptionA no-arg constructorXzResource(ResourceCollection other) Constructor with another resource to wrap. -
Method Summary
Modifier and TypeMethodDescriptionprotected StringGet the name of the compression method.protected InputStreamDecompress on the fly using java.util.zip.XZInputStream.protected OutputStreamwrapStream(OutputStream out) Compress on the fly using java.util.zip.XZOutStream.Methods inherited from class org.apache.tools.ant.types.resources.CompressedResource
toStringMethods inherited from class org.apache.tools.ant.types.resources.ContentTransformingResource
as, getInputStream, getOutputStream, getSize, isAppendSupportedMethods 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, setSizeMethods inherited from class org.apache.tools.ant.types.Resource
asOptional, clone, equals, getMagicNumber, getRef, iterator, size, toLongStringMethods 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, tooManyAttributesMethods inherited from class org.apache.tools.ant.ProjectComponent
getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProjectMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface org.apache.tools.ant.types.ResourceCollection
isEmpty, stream
-
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
Decompress on the fly using java.util.zip.XZInputStream.- Specified by:
wrapStreamin classContentTransformingResource- Parameters:
in- the stream to wrap.- Returns:
- the wrapped stream.
- Throws:
IOException- if there is a problem.
-
wrapStream
Compress on the fly using java.util.zip.XZOutStream.- Specified by:
wrapStreamin classContentTransformingResource- Parameters:
out- the stream to wrap.- Returns:
- the wrapped stream.
- Throws:
IOException- if there is a problem.
-
getCompressionName
Get the name of the compression method.- Specified by:
getCompressionNamein classCompressedResource- Returns:
- the string "XZ".
-