Class XzResource

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
  • Constructor Details

    • XzResource

      public XzResource()
      A no-arg constructor
    • XzResource

      public XzResource​(ResourceCollection other)
      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.IOException
      Decompress on the fly using java.util.zip.XZInputStream.
      Specified by:
      wrapStream in class ContentTransformingResource
      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.IOException
      Compress on the fly using java.util.zip.XZOutStream.
      Specified by:
      wrapStream in class ContentTransformingResource
      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 class CompressedResource
      Returns:
      the string "XZ".