@Singleton public class PlanFiles extends java.lang.Object implements SubSystem
Modifier and Type | Field and Description |
---|---|
protected PlanPlugin |
plugin |
Constructor and Description |
---|
PlanFiles(PlanPlugin plugin) |
Modifier and Type | Method and Description |
---|---|
void |
disable()
Performs disable actions for the subsystem
|
void |
enable()
Performs enable actions for the subsystem.
|
java.io.File |
getConfigFile() |
Resource |
getCustomizableResourceOrDefault(java.lang.String resourceName)
Get a customizable resource from the plugin files or from the jar if one doesn't exist.
|
java.nio.file.Path |
getDataDirectory() |
java.io.File |
getDataFolder() |
java.io.File |
getFileFromPluginFolder(java.lang.String name) |
java.io.File |
getLocaleFile() |
java.io.File |
getLogsFolder() |
Resource |
getResourceFromJar(java.lang.String resourceName)
Get a file in the jar as a
Resource . |
Resource |
getResourceFromPluginFolder(java.lang.String resourceName)
Get a file from plugin folder as a
Resource . |
protected final PlanPlugin plugin
@Inject public PlanFiles(PlanPlugin plugin)
public java.io.File getDataFolder()
public java.nio.file.Path getDataDirectory()
public java.io.File getLogsFolder()
public java.io.File getConfigFile()
public java.io.File getLocaleFile()
public java.io.File getFileFromPluginFolder(java.lang.String name)
public void enable() throws EnableException
SubSystem
enable
in interface SubSystem
EnableException
- If an error occurred during enable and it is fatal to the subsystem.public void disable()
SubSystem
public Resource getResourceFromJar(java.lang.String resourceName)
Resource
.resourceName
- Path to the file inside jar/assets/plan/ folder.Resource
for accessing the resource.public Resource getResourceFromPluginFolder(java.lang.String resourceName)
Resource
.resourceName
- Path to the file inside the plugin folder.Resource
for accessing the resource.public Resource getCustomizableResourceOrDefault(java.lang.String resourceName)
resourceName
- Path to the file inside the plugin folder.Resource
for accessing the resource, either from the plugin folder or jar.