Class IncludeResourceTransformer

  • All Implemented Interfaces:
    ResourceTransformer

    public class IncludeResourceTransformer
    extends java.lang.Object
    implements ResourceTransformer
    A resource processor that allows the addition of an arbitrary file content into the shaded JAR.
    • Field Detail

      • file

        java.io.File file
      • resource

        java.lang.String resource
    • Constructor Detail

      • IncludeResourceTransformer

        public IncludeResourceTransformer()
    • 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
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object