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.
Constructor and Description |
---|
FileManager() |
Modifier and Type | Method and Description |
---|---|
void |
addFile(JavaFile file)
Add a file to this file manager.
|
String |
getEncoding()
Gets the encoding of source files.
|
JavaFile |
getFile(Path path)
Gets a file from its name.
If the file does not exist within the FileManager, creates a new one and returns it. |
void |
setEncoding(String encoding)
Sets the encoding of source files.
|
public JavaFile getFile(Path path) throws IOException
path
- path of the fileJavaFile
meta object for the specified fileIOException
- on parsing failurepublic void addFile(JavaFile file)
file
- file to addpublic void setEncoding(String encoding)
encoding
- encoding of source filespublic String getEncoding()
Copyright © 2002–2024 The Apache Software Foundation. All rights reserved.