Class InMemoryJar


  • public class InMemoryJar
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) java.io.ByteArrayOutputStream bos  
      private java.util.jar.Manifest manifest  
      (package private) java.util.jar.JarOutputStream target  
    • Constructor Summary

      Constructors 
      Constructor Description
      InMemoryJar()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addFile​(byte[] body, java.lang.String fqn)  
      private static void addFile​(java.util.jar.JarOutputStream target, byte[] body, java.lang.String fqn)  
      void addToManifest​(java.lang.String key, java.lang.String value)  
      void close()  
      void open()  
      java.util.jar.JarOutputStream openJar​(java.io.OutputStream os)  
      java.io.File save()  
      void save​(java.io.File f)  
      void setMainClass​(java.lang.String mainFqn)  
      void startManifest()  
      byte[] toBytes()  
      • Methods inherited from class java.lang.Object

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

      • manifest

        private java.util.jar.Manifest manifest
      • bos

        java.io.ByteArrayOutputStream bos
      • target

        java.util.jar.JarOutputStream target
    • Constructor Detail

      • InMemoryJar

        public InMemoryJar()
    • Method Detail

      • startManifest

        public void startManifest()
      • setMainClass

        public void setMainClass​(java.lang.String mainFqn)
      • addToManifest

        public void addToManifest​(java.lang.String key,
                                  java.lang.String value)
      • openJar

        public java.util.jar.JarOutputStream openJar​(java.io.OutputStream os)
                                              throws java.io.IOException
        Throws:
        java.io.IOException
      • addFile

        private static void addFile​(java.util.jar.JarOutputStream target,
                                    byte[] body,
                                    java.lang.String fqn)
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • addFile

        public void addFile​(byte[] body,
                            java.lang.String fqn)
                     throws java.io.IOException
        Throws:
        java.io.IOException
      • open

        public void open()
                  throws java.io.IOException
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Throws:
        java.io.IOException
      • save

        public java.io.File save()
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • save

        public void save​(java.io.File f)
                  throws java.io.IOException
        Throws:
        java.io.IOException
      • toBytes

        public byte[] toBytes()
                       throws java.io.IOException
        Throws:
        java.io.IOException