Class ManifestResourceTransformer

  • All Implemented Interfaces:
    ResourceTransformer

    public class ManifestResourceTransformer
    extends java.lang.Object
    implements ResourceTransformer
    A resource processor that allows the arbitrary addition of attributes to the first MANIFEST.MF that is found in the set of JARs being processed, or to a newly created manifest for the shaded JAR.
    Since:
    1.2
    • Field Detail

      • mainClass

        private java.lang.String mainClass
      • manifestEntries

        private java.util.Map<java.lang.String,​java.lang.Object> manifestEntries
      • manifestDiscovered

        private boolean manifestDiscovered
      • manifest

        private java.util.jar.Manifest manifest
    • Constructor Detail

      • ManifestResourceTransformer

        public ManifestResourceTransformer()
    • Method Detail

      • processResource

        public void processResource​(java.lang.String resource,
                                    java.io.InputStream is,
                                    java.util.List<Relocator> relocators)
                             throws java.io.IOException
        Description copied from interface: ResourceTransformer
        Transform an individual resource
        Specified by:
        processResource in interface ResourceTransformer
        Parameters:
        resource - The resoure name
        is - An input stream for the resource, the implementation should *not* close this stream
        relocators - A list of relocators
        Throws:
        java.io.IOException - When the IO blows up
      • modifyOutputStream

        public void modifyOutputStream​(java.util.jar.JarOutputStream jos)
                                throws java.io.IOException
        Specified by:
        modifyOutputStream in interface ResourceTransformer
        Throws:
        java.io.IOException