Package net.bytebuddy.dynamic
Class ClassFileLocator.ForFolder
java.lang.Object
net.bytebuddy.dynamic.ClassFileLocator.MultiReleaseAware
net.bytebuddy.dynamic.ClassFileLocator.ForFolder
- All Implemented Interfaces:
Closeable
,AutoCloseable
,ClassFileLocator
- Enclosing interface:
ClassFileLocator
A class file locator that finds files from a standardized Java folder structure with
folders donating packages and class files being saved as
<classname>.class
files
within their package folder.-
Nested Class Summary
Nested classes/interfaces inherited from interface net.bytebuddy.dynamic.ClassFileLocator
ClassFileLocator.Compound, ClassFileLocator.Filtering, ClassFileLocator.ForClassLoader, ClassFileLocator.ForFolder, ClassFileLocator.ForInstrumentation, ClassFileLocator.ForJarFile, ClassFileLocator.ForModule, ClassFileLocator.ForModuleFile, ClassFileLocator.ForUrl, ClassFileLocator.MultiReleaseAware, ClassFileLocator.NoOp, ClassFileLocator.PackageDiscriminating, ClassFileLocator.Resolution, ClassFileLocator.Simple
-
Field Summary
FieldsFields inherited from class net.bytebuddy.dynamic.ClassFileLocator.MultiReleaseAware
NO_MULTI_RELEASE
Fields inherited from interface net.bytebuddy.dynamic.ClassFileLocator
CLASS_FILE_EXTENSION, META_INF_VERSIONS
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
protected byte[]
Resolves a possible multi-release entry, if it exists.static ClassFileLocator
of
(File folder, ClassFileVersion classFileVersion) Creates a new class file locator for a folder structure of class files.Methods inherited from class net.bytebuddy.dynamic.ClassFileLocator.MultiReleaseAware
locate
-
Field Details
-
folder
The base folder of the package structure.
-
-
Constructor Details
-
ForFolder
Creates a new class file locator for a folder structure of class files.- Parameters:
folder
- The base folder of the package structure.
-
ForFolder
Creates a new class file locator for a folder structure of class files.- Parameters:
version
- Contains the existing multi-release jar folders that are available for the current JVM version in decreasing order.folder
- The base folder of the package structure.
-
-
Method Details
-
of
public static ClassFileLocator of(File folder, ClassFileVersion classFileVersion) throws IOException Creates a new class file locator for a folder structure of class files. The created locator considers the provided class file version when resolving class files and if multiple versions are available- Parameters:
folder
- The base folder of the package structure.classFileVersion
- The class file version to consider for multi-release JAR files.- Returns:
- An appropriate class file locator.
- Throws:
IOException
- If an I/O exception occurs.
-
doLocate
Resolves a possible multi-release entry, if it exists.- Specified by:
doLocate
in classClassFileLocator.MultiReleaseAware
- Parameters:
path
- The path of the class file.- Returns:
- The class file's binary representation or
null
if it does not exist. - Throws:
IOException
- If an I/O exception occurs.
-
close
public void close()
-