Package ghidra.app.script

# Class ResourceFileJavaFileManager

java.lang.Object
ghidra.app.script.ResourceFileJavaFileManager

All Implemented Interfaces:
  `Closeable`, `Flushable`, `AutoCloseable`, `JavaFileManager`, `OptionChecker`

public class ResourceFileJavaFileManager extends Object implements JavaFileManager
A `JavaFileManager` that works with Ghidra's `ResourceFile`s.

This class is used to dynamically compile Ghidra scripts.

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from interface javax.tools.JavaFileManager

  `JavaFileManager.Location`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ResourceFileJavaFileManager(List<ResourceFile> sourceDirs, Set<ResourceFile> filesToAvoid)`
  Create a `JavaFileManager` for use by the `JavaCompiler`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `close()`
  `boolean`
  `contains(JavaFileManager.Location location, FileObject fo)`
  `void`
  `flush()`
  `ClassLoader`
  `getClassLoader(JavaFileManager.Location location)`
  `FileObject`
  `getFileForInput(JavaFileManager.Location location, String packageName, String relativeName)`
  `FileObject`
  `getFileForOutput(JavaFileManager.Location location, String packageName, String relativeName, FileObject sibling)`
  `JavaFileObject`
  `getJavaFileForInput(JavaFileManager.Location location, String className, JavaFileObject.Kind kind)`
  `JavaFileObject`
  `getJavaFileForOutput(JavaFileManager.Location location, String className, JavaFileObject.Kind kind, FileObject sibling)`
  `JavaFileManager.Location`
  `getLocationForModule(JavaFileManager.Location location, String moduleName)`
  `JavaFileManager.Location`
  `getLocationForModule(JavaFileManager.Location location, JavaFileObject fo)`
  `<S> ServiceLoader<S>`
  `getServiceLoader(JavaFileManager.Location location, Class<S> service)`
  `boolean`
  `handleOption(String current, Iterator<String> remaining)`
  `boolean`
  `hasLocation(JavaFileManager.Location location)`
  `String`
  `inferBinaryName(JavaFileManager.Location location, JavaFileObject file)`
  `String`
  `inferModuleName(JavaFileManager.Location location)`
  `boolean`
  `isSameFile(FileObject a, FileObject b)`
  `int`
  `isSupportedOption(String option)`
  `Iterable<JavaFileObject>`
  `list(JavaFileManager.Location location, String packageName, Set<JavaFileObject.Kind> kinds, boolean recurse)`
  `Iterable<Set<JavaFileManager.Location>>`
  `listLocationsForModules(JavaFileManager.Location location)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface javax.tools.JavaFileManager

  `getFileForOutputForOriginatingFiles, getJavaFileForOutputForOriginatingFiles`

- ## Constructor Details

  - ### ResourceFileJavaFileManager

    public ResourceFileJavaFileManager(List<ResourceFile> sourceDirs, Set<ResourceFile> filesToAvoid)
    Create a `JavaFileManager` for use by the `JavaCompiler`.
    Parameters:
      `sourceDirs` - the directories containing source
      `filesToAvoid` - known "bad" files to hide from the compiler

- ## Method Details

  - ### isSupportedOption

    public int isSupportedOption(String option)
    Specified by:
      `isSupportedOption` in interface `OptionChecker`

  - ### getClassLoader

    public ClassLoader getClassLoader(JavaFileManager.Location location)
    Specified by:
      `getClassLoader` in interface `JavaFileManager`

  - ### list

    public Iterable<JavaFileObject> list(JavaFileManager.Location location, String packageName, Set<JavaFileObject.Kind> kinds, boolean recurse) throws IOException
    Specified by:
      `list` in interface `JavaFileManager`
    Throws:
      `IOException`

  - ### inferBinaryName

    public String inferBinaryName(JavaFileManager.Location location, JavaFileObject file)
    Specified by:
      `inferBinaryName` in interface `JavaFileManager`

  - ### isSameFile

    public boolean isSameFile(FileObject a, FileObject b)
    Specified by:
      `isSameFile` in interface `JavaFileManager`

  - ### handleOption

    public boolean handleOption(String current, Iterator<String> remaining)
    Specified by:
      `handleOption` in interface `JavaFileManager`

  - ### hasLocation

    public boolean hasLocation(JavaFileManager.Location location)
    Specified by:
      `hasLocation` in interface `JavaFileManager`

  - ### getJavaFileForInput

    public JavaFileObject getJavaFileForInput(JavaFileManager.Location location, String className, JavaFileObject.Kind kind) throws IOException
    Specified by:
      `getJavaFileForInput` in interface `JavaFileManager`
    Throws:
      `IOException`

  - ### getJavaFileForOutput

    public JavaFileObject getJavaFileForOutput(JavaFileManager.Location location, String className, JavaFileObject.Kind kind, FileObject sibling) throws IOException
    Specified by:
      `getJavaFileForOutput` in interface `JavaFileManager`
    Throws:
      `IOException`

  - ### getFileForInput

    public FileObject getFileForInput(JavaFileManager.Location location, String packageName, String relativeName) throws IOException
    Specified by:
      `getFileForInput` in interface `JavaFileManager`
    Throws:
      `IOException`

  - ### getFileForOutput

    public FileObject getFileForOutput(JavaFileManager.Location location, String packageName, String relativeName, FileObject sibling) throws IOException
    Specified by:
      `getFileForOutput` in interface `JavaFileManager`
    Throws:
      `IOException`

  - ### flush

    public void flush() throws IOException
    Specified by:
      `flush` in interface `Flushable`
    Specified by:
      `flush` in interface `JavaFileManager`
    Throws:
      `IOException`

  - ### close

    public void close() throws IOException
    Specified by:
      `close` in interface `AutoCloseable`
    Specified by:
      `close` in interface `Closeable`
    Specified by:
      `close` in interface `JavaFileManager`
    Throws:
      `IOException`

  - ### getLocationForModule

    public JavaFileManager.Location getLocationForModule(JavaFileManager.Location location, String moduleName) throws IOException
    Specified by:
      `getLocationForModule` in interface `JavaFileManager`
    Throws:
      `IOException`

  - ### getLocationForModule

    public JavaFileManager.Location getLocationForModule(JavaFileManager.Location location, JavaFileObject fo) throws IOException
    Specified by:
      `getLocationForModule` in interface `JavaFileManager`
    Throws:
      `IOException`

  - ### inferModuleName

    public String inferModuleName(JavaFileManager.Location location) throws IOException
    Specified by:
      `inferModuleName` in interface `JavaFileManager`
    Throws:
      `IOException`

  - ### listLocationsForModules

    public Iterable<Set<JavaFileManager.Location>> listLocationsForModules(JavaFileManager.Location location) throws IOException
    Specified by:
      `listLocationsForModules` in interface `JavaFileManager`
    Throws:
      `IOException`

  - ### contains

    public boolean contains(JavaFileManager.Location location, FileObject fo) throws IOException
    Specified by:
      `contains` in interface `JavaFileManager`
    Throws:
      `IOException`

  - ### getServiceLoader

    public <S> ServiceLoader<S> getServiceLoader(JavaFileManager.Location location, Class<S> service) throws IOException
    Specified by:
      `getServiceLoader` in interface `JavaFileManager`
    Throws:
      `IOException`