Class CommonsCompressCodecFactory


  • @Internal
    @Contract(threading=STATELESS)
    final class CommonsCompressCodecFactory
    extends java.lang.Object
    Codecs factory for Apache Commons Compress.

    Use runtimeAvailable(ContentCoding) to probe whether a given coding can be provided by the current classpath configuration. Callers can then register codecs conditionally without hard dependencies.

    Since:
    5.6
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.lang.String CC_BROTLI  
      private static java.lang.String CC_BZIP2  
      private static java.lang.String CC_DEFLATE64  
      private static java.lang.String CC_LZ4_B  
      private static java.lang.String CC_LZ4_F  
      private static java.lang.String CC_LZMA  
      private static java.lang.String CC_PACK200  
      private static java.lang.String CC_XZ  
      private static java.lang.String CC_ZSTD  
      private static java.lang.String FACTORY_CLASS  
      private static java.lang.String H_BROTLI  
      private static java.lang.String H_XZ  
      private static java.lang.String H_ZSTD  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) static org.apache.hc.core5.io.IOFunction<java.io.InputStream,​java.io.InputStream> decoder​(java.lang.String token)
      Creates a lazy decoder that instantiates the Commons Compress stream.
      (package private) static org.apache.hc.core5.io.IOFunction<java.io.OutputStream,​java.io.OutputStream> encoder​(java.lang.String token)
      Creates a lazy encoder that instantiates the Commons Compress stream.
      private static boolean isPresent​(java.lang.String className)  
      (package private) static boolean runtimeAvailable​(ContentCoding coding)
      Best-effort availability probe for optional Commons-Compress codecs.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CommonsCompressCodecFactory

        private CommonsCompressCodecFactory()
    • Method Detail

      • isPresent

        private static boolean isPresent​(java.lang.String className)
      • decoder

        static org.apache.hc.core5.io.IOFunction<java.io.InputStream,​java.io.InputStream> decoder​(java.lang.String token)
        Creates a lazy decoder that instantiates the Commons Compress stream.
      • encoder

        static org.apache.hc.core5.io.IOFunction<java.io.OutputStream,​java.io.OutputStream> encoder​(java.lang.String token)
        Creates a lazy encoder that instantiates the Commons Compress stream.
      • runtimeAvailable

        static boolean runtimeAvailable​(ContentCoding coding)
        Best-effort availability probe for optional Commons-Compress codecs.

        Returns true only if the CC factory and the codec-specific implementation (and helper classes if required) are present on the classpath. Built-in gzip/deflate are handled elsewhere and are not probed here.