Class FileManager

java.lang.Object
org.apache.maven.jxr.pacman.FileManager

public class FileManager extends Object

Singleton that handles holding references to JavaFiles. This allows Alexandria to lookup and see if a file has already been parsed out and then it can load the information from memory instead of reparsing the file.

Note. This assumes that the file will not be modified on disk while Alexandria is running.

  • Field Details

  • Constructor Details

    • FileManager

      public FileManager()
  • Method Details

    • getFile

      public JavaFile getFile(Path path) throws IOException
      Gets a file from its name.
      If the file does not exist within the FileManager, creates a new one and returns it.
      Parameters:
      path - path of the file
      Returns:
      the JavaFile meta object for the specified file
      Throws:
      IOException - on parsing failure
    • addFile

      public void addFile(JavaFile file)
      Add a file to this file manager.
      Parameters:
      file - file to add
    • setEncoding

      public void setEncoding(String encoding)
      Sets the encoding of source files.
      Parameters:
      encoding - encoding of source files
    • getEncoding

      public String getEncoding()
      Gets the encoding of source files.
      Returns:
      encoding