Class ZipEncodingHelper


  • public abstract class ZipEncodingHelper
    extends java.lang.Object
    Static helper functions for robustly encoding file names in zip files.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static ZipEncoding getZipEncoding​(java.lang.String name)
      Instantiates a zip encoding.
      • Methods inherited from class java.lang.Object

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

      • ZipEncodingHelper

        public ZipEncodingHelper()
    • Method Detail

      • getZipEncoding

        public static ZipEncoding getZipEncoding​(java.lang.String name)
        Instantiates a zip encoding. An NIO based character set encoder/decoder will be returned. As a special case, if the character set is UTF-8, the nio encoder will be configured replace malformed and unmappable characters with '?'. This matches existing behavior from the older fallback encoder.

        If the requested character set cannot be found, the platform default will be used instead.

        Parameters:
        name - The name of the zip encoding. Specify null for the platform's default encoding.
        Returns:
        A zip encoding for the given encoding name.