Package net.bytebuddy.build
Class Plugin.Engine.Target.ForFolder
java.lang.Object
net.bytebuddy.build.Plugin.Engine.Target.ForFolder
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Plugin.Engine.Target
,Plugin.Engine.Target.Sink
- Enclosing interface:
Plugin.Engine.Target
@Enhance
public static class Plugin.Engine.Target.ForFolder
extends Object
implements Plugin.Engine.Target, Plugin.Engine.Target.Sink
Represents a folder as the target for a plugin engine's application.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.bytebuddy.build.Plugin.Engine.Target
Plugin.Engine.Target.Discarding, Plugin.Engine.Target.ForFolder, Plugin.Engine.Target.ForJarFile, Plugin.Engine.Target.InMemory, Plugin.Engine.Target.Sink
Nested classes/interfaces inherited from interface net.bytebuddy.build.Plugin.Engine.Target.Sink
Plugin.Engine.Target.Sink.ForJarOutputStream
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
private static void
doStore
(File folder, Map<TypeDescription, byte[]> binaryRepresentations) Stores binary representations to a folder.void
retain
(Plugin.Engine.Source.Element element) Retains the supplied element in its original form.void
store
(Map<TypeDescription, byte[]> binaryRepresentations) Stores the supplied binary representation of types in this sink.void
store
(ClassFileVersion classFileVersion, Map<TypeDescription, byte[]> binaryRepresentations) Stores the supplied binary representation of types in this sink.Initializes this target prior to writing.
-
Field Details
-
folder
The folder that is represented by this instance. -
link
private final boolean linktrue
if retained files should be linked and not copied.
-
-
Constructor Details
-
ForFolder
Creates a new target for a folder.- Parameters:
folder
- The folder that is represented by this instance.
-
ForFolder
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 Details
-
doStore
private static void doStore(File folder, Map<TypeDescription, byte[]> binaryRepresentations) throws IOExceptionStores binary representations to a folder.- Parameters:
folder
- The base folder.binaryRepresentations
- The binary representations to store.- Throws:
IOException
- If an I/O exception occurs.
-
write
Initializes this target prior to writing.- Specified by:
write
in interfacePlugin.Engine.Target
- Parameters:
manifest
- The manifest for the target ornull
if no manifest was found.- Returns:
- The sink to write to.
- Throws:
IOException
- If an I/O error occurs.
-
store
Stores the supplied binary representation of types in this sink.- Specified by:
store
in interfacePlugin.Engine.Target.Sink
- Parameters:
binaryRepresentations
- The binary representations to store.- Throws:
IOException
- If an I/O error occurs.
-
store
public void store(ClassFileVersion classFileVersion, Map<TypeDescription, byte[]> binaryRepresentations) throws IOExceptionStores the supplied binary representation of types in this sink.- Specified by:
store
in interfacePlugin.Engine.Target.Sink
- Parameters:
classFileVersion
- The version of the multi-release jar file, which should at least be8
as previous versions are not recognized by regular class loaders.binaryRepresentations
- The binary representations to store.- Throws:
IOException
- If an I/O error occurs.
-
retain
Retains the supplied element in its original form.- Specified by:
retain
in interfacePlugin.Engine.Target.Sink
- Parameters:
element
- The element to retain.- Throws:
IOException
- If an I/O error occurs.
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-