Class Plugin.Engine.Target.ForFolder

    • Field Detail

      • folder

        private final java.io.File folder
        The folder that is represented by this instance.
      • link

        private final boolean link
        true if retained files should be linked and not copied.
    • Constructor Detail

      • ForFolder

        public ForFolder​(java.io.File folder)
        Creates a new target for a folder.
        Parameters:
        folder - The folder that is represented by this instance.
      • ForFolder

        public ForFolder​(java.io.File folder,
                         boolean link)
        Creates a new target for a folder.
        Parameters:
        folder - The folder that is represented by this instance.
        link - true if retained files should be linked and not copied.
    • Method Detail

      • doStore

        private static void doStore​(java.io.File folder,
                                    java.util.Map<TypeDescription,​byte[]> binaryRepresentations)
                             throws java.io.IOException
        Stores binary representations to a folder.
        Parameters:
        folder - The base folder.
        binaryRepresentations - The binary representations to store.
        Throws:
        java.io.IOException - If an I/O exception occurs.
      • write

        public Plugin.Engine.Target.Sink write​(@MaybeNull
                                               java.util.jar.Manifest manifest)
                                        throws java.io.IOException
        Initializes this target prior to writing.
        Specified by:
        write in interface Plugin.Engine.Target
        Parameters:
        manifest - The manifest for the target or null if no manifest was found.
        Returns:
        The sink to write to.
        Throws:
        java.io.IOException - If an I/O error occurs.
      • store

        public void store​(java.util.Map<TypeDescription,​byte[]> binaryRepresentations)
                   throws java.io.IOException
        Stores the supplied binary representation of types in this sink.
        Specified by:
        store in interface Plugin.Engine.Target.Sink
        Parameters:
        binaryRepresentations - The binary representations to store.
        Throws:
        java.io.IOException - If an I/O error occurs.
      • store

        public void store​(ClassFileVersion classFileVersion,
                          java.util.Map<TypeDescription,​byte[]> binaryRepresentations)
                   throws java.io.IOException
        Stores the supplied binary representation of types in this sink.
        Specified by:
        store in interface Plugin.Engine.Target.Sink
        Parameters:
        classFileVersion - The version of the multi-release jar file, which should at least be 8 as previous versions are not recognized by regular class loaders.
        binaryRepresentations - The binary representations to store.
        Throws:
        java.io.IOException - If an I/O error occurs.
      • retain

        public void retain​(Plugin.Engine.Source.Element element)
                    throws java.io.IOException
        Retains the supplied element in its original form.
        Specified by:
        retain in interface Plugin.Engine.Target.Sink
        Parameters:
        element - The element to retain.
        Throws:
        java.io.IOException - If an I/O error occurs.
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable