Package net.bytebuddy.build
Class Plugin.Engine.Source.Element.ForFile
- java.lang.Object
-
- net.bytebuddy.build.Plugin.Engine.Source.Element.ForFile
-
- All Implemented Interfaces:
Plugin.Engine.Source.Element
- Enclosing interface:
- Plugin.Engine.Source.Element
@Enhance public static class Plugin.Engine.Source.Element.ForFile extends java.lang.Object implements Plugin.Engine.Source.Element
An element representation for a file.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.bytebuddy.build.Plugin.Engine.Source.Element
Plugin.Engine.Source.Element.ForByteArray, Plugin.Engine.Source.Element.ForFile, Plugin.Engine.Source.Element.ForJarEntry
-
-
Constructor Summary
Constructors Constructor Description ForFile(java.io.File root, java.io.File file)Creates an element representation for a file.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.InputStreamgetInputStream()Returns an input stream to read this element's binary information.java.lang.StringgetName()Returns the element's relative path and name.<T> TresolveAs(java.lang.Class<T> type)Resolves this element to a more specialized form if possible.
-
-
-
Method Detail
-
getName
public java.lang.String getName()
Returns the element's relative path and name. If the name ends with a/, it represents a folder.- Specified by:
getNamein interfacePlugin.Engine.Source.Element- Returns:
- The element's path and name.
-
getInputStream
public java.io.InputStream getInputStream() throws java.io.IOExceptionReturns an input stream to read this element's binary information. Must not be invoked for folders.- Specified by:
getInputStreamin interfacePlugin.Engine.Source.Element- Returns:
- An input stream that represents this element's binary information.
- Throws:
java.io.IOException- If an I/O error occurs.
-
resolveAs
@MaybeNull public <T> T resolveAs(java.lang.Class<T> type)
Resolves this element to a more specialized form if possible. Doing so allows for performance optimizations if more specialized formats are available.- Specified by:
resolveAsin interfacePlugin.Engine.Source.Element- Type Parameters:
T- The requested spezialized type.- Parameters:
type- The requested spezialized type.- Returns:
- The resolved element or
nullif a transformation is impossible.
-
-