Class ManifestUtil


  • public final class ManifestUtil
    extends java.lang.Object
    Unfortunately we have to write our own manifest :-( because of a stupid bug in the manifest code. It tries to handle UTF-8 but the way it does it it makes the bytes platform dependent. So the following code outputs the manifest. A Manifest consists of
     'Manifest-Version: 1.0\r\n'
     main-attributes * \r\n name-section
     main-attributes ::= attributes
     attributes ::= key ': ' value '\r\n'
     name-section ::= 'Name: ' name '\r\n' attributes
     
    Lines in the manifest should not exceed 72 bytes (! this is where the manifest screwed up as well when 16 bit unicodes were used).

    As a bonus, we can now sort the manifest!

    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void write​(java.util.jar.Manifest manifest, java.io.OutputStream out)  
      • Methods inherited from class java.lang.Object

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

      • write

        public static void write​(java.util.jar.Manifest manifest,
                                 java.io.OutputStream out)
                          throws java.io.IOException
        Throws:
        java.io.IOException