public final class FileManager
extends java.lang.Object
Constructor and Description |
---|
FileManager() |
Modifier and Type | Method and Description |
---|---|
boolean |
exists(java.lang.String name)
Check if a file is stored under an identifier.
|
<T> T |
get(java.lang.String name)
Get the raw type instance of a stored file/config (FileWrapper or FileConfiguration)
|
FileConfiguration |
getConfig(java.lang.String name)
Get a FileConfiguration that's stored in the file manager.
|
FileConfiguration |
loadConfig(java.lang.String name,
java.lang.String internalPath,
java.lang.String externalPath)
Load a config into the FileManager
|
FileWrapper |
loadFile(java.lang.String name,
java.lang.String internalPath,
java.lang.String externalPath)
Load a file into the FileManager
|
void |
save(java.lang.String name)
Save a MutableFileConfiguration to file.
|
void |
update(java.lang.String name)
Update instances of AbstractFileConfigurations or FileWrappers with physical changes to their respective files by the user.
|
public FileWrapper loadFile(java.lang.String name, java.lang.String internalPath, java.lang.String externalPath) throws java.lang.Exception
name
- Name the file will be referenced byinternalPath
- Internal path of the file to be exportedexternalPath
- External path to save and load the file fromjava.lang.Exception
- Will throw if IO, BadConfigType, or UnknownConfigType exceptions are encounteredpublic FileConfiguration loadConfig(java.lang.String name, java.lang.String internalPath, java.lang.String externalPath) throws java.lang.Exception
name
- Name the config will be referenced byinternalPath
- Internal path of the config to be exportedexternalPath
- External path to save and load the config fromjava.lang.Exception
- Will throw if IO, BadConfigType, or UnknownConfigType exceptions are encounteredpublic FileConfiguration getConfig(java.lang.String name)
name
- Name of the configpublic boolean exists(java.lang.String name)
name
- Name of the filepublic <T> T get(java.lang.String name)
T
- Typename
- Name of the filepublic void update(java.lang.String name) throws java.lang.Exception
name
- Reference to the stored objectjava.lang.Exception
- IO errorpublic void save(java.lang.String name) throws java.lang.Exception
name
- Name of the fileconfiguration.java.lang.Exception
- May throw on IO error