Class Pack200Utils


  • public class Pack200Utils
    extends java.lang.Object
    Utility methods for Pack200.
    Since:
    1.3
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void normalize​(java.io.File jar)
      Normalizes a JAR archive in-place so it can be safely signed and packed.
      static void normalize​(java.io.File from, java.io.File to)
      Normalizes a JAR archive so it can be safely signed and packed.
      static void normalize​(java.io.File from, java.io.File to, java.util.Map<java.lang.String,​java.lang.String> props)
      Normalizes a JAR archive so it can be safely signed and packed.
      static void normalize​(java.io.File jar, java.util.Map<java.lang.String,​java.lang.String> props)
      Normalizes a JAR archive in-place so it can be safely signed and packed.
      • Methods inherited from class java.lang.Object

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

      • normalize

        public static void normalize​(java.io.File jar)
                              throws java.io.IOException
        Normalizes a JAR archive in-place so it can be safely signed and packed.

        As stated in Pack200.Packer's javadocs applying a Pack200 compression to a JAR archive will in general make its signatures invalid. In order to prepare a JAR for signing it should be "normalized" by packing and unpacking it. This is what this method does.

        Note this methods implicitly sets the segment length to -1.

        Parameters:
        jar - the JAR archive to normalize
        Throws:
        java.io.IOException - if reading or writing fails
      • normalize

        public static void normalize​(java.io.File jar,
                                     java.util.Map<java.lang.String,​java.lang.String> props)
                              throws java.io.IOException
        Normalizes a JAR archive in-place so it can be safely signed and packed.

        As stated in Pack200.Packer's javadocs applying a Pack200 compression to a JAR archive will in general make its signatures invalid. In order to prepare a JAR for signing it should be "normalized" by packing and unpacking it. This is what this method does.

        Parameters:
        jar - the JAR archive to normalize
        props - properties to set for the pack operation. This method will implicitly set the segment limit to -1.
        Throws:
        java.io.IOException - if reading or writing fails
      • normalize

        public static void normalize​(java.io.File from,
                                     java.io.File to)
                              throws java.io.IOException
        Normalizes a JAR archive so it can be safely signed and packed.

        As stated in Pack200.Packer's javadocs applying a Pack200 compression to a JAR archive will in general make its signatures invalid. In order to prepare a JAR for signing it should be "normalized" by packing and unpacking it. This is what this method does.

        This method does not replace the existing archive but creates a new one.

        Note this methods implicitly sets the segment length to -1.

        Parameters:
        from - the JAR archive to normalize
        to - the normalized archive
        Throws:
        java.io.IOException - if reading or writing fails
      • normalize

        public static void normalize​(java.io.File from,
                                     java.io.File to,
                                     java.util.Map<java.lang.String,​java.lang.String> props)
                              throws java.io.IOException
        Normalizes a JAR archive so it can be safely signed and packed.

        As stated in Pack200.Packer's javadocs applying a Pack200 compression to a JAR archive will in general make its signatures invalid. In order to prepare a JAR for signing it should be "normalized" by packing and unpacking it. This is what this method does.

        This method does not replace the existing archive but creates a new one.

        Parameters:
        from - the JAR archive to normalize
        to - the normalized archive
        props - properties to set for the pack operation. This method will implicitly set the segment limit to -1.
        Throws:
        java.io.IOException - if reading or writing fails