Class ClassFileLocator.ForFolder

java.lang.Object
net.bytebuddy.dynamic.ClassFileLocator.ForFolder
All Implemented Interfaces:
Closeable, AutoCloseable, ClassFileLocator
Enclosing interface:
ClassFileLocator

@Enhance public static class ClassFileLocator.ForFolder extends Object implements 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.
  • Field Details

    • folder

      private final File folder
      The base folder of the package structure.
  • Constructor Details

    • ForFolder

      public ForFolder(File folder)
      Creates a new class file locator for a folder structure of class files.
      Parameters:
      folder - The base folder of the package structure.
  • Method Details

    • locate

      public ClassFileLocator.Resolution locate(String name) throws IOException
      Locates the class file for a given type and returns the binary data of the class file.
      Specified by:
      locate in interface ClassFileLocator
      Parameters:
      name - The name of the type to locate a class file representation for.
      Returns:
      Any binary representation of the type which might be illegal.
      Throws:
      IOException - If reading a class file causes an error.
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable