Package com.djrapitops.plan.storage.file
Class PlanFiles
java.lang.Object
com.djrapitops.plan.storage.file.PlanFiles
- All Implemented Interfaces:
SubSystem
- Direct Known Subclasses:
SpongePlanFiles
Abstracts File methods of Plugin classes so that they can be tested without Mocks.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionattemptToFind(String resourceName)
void
disable()
Performs disable actions for the subsystemvoid
enable()
Performs enable actions for the subsystem.getCustomizableResource(String resourceName)
getFileFromPluginFolder(String name)
getResourceFromJar(String resourceName)
Get a file in the jar as aResource
.getResourceFromPluginFolder(String resourceName)
Get a file from plugin folder as aResource
.
-
Field Details
-
getResourceStream
-
-
Constructor Details
-
PlanFiles
@Inject public PlanFiles(@Named("dataFolder") File dataFolder, JarResource.StreamFunction getResourceStream)
-
-
Method Details
-
getDataFolder
-
getDataDirectory
-
getCustomizationDirectory
-
getLogsFolder
-
getLogsDirectory
-
getConfigFile
-
getLocaleFile
-
getFileFromPluginFolder
-
enable
public void enable()Description copied from interface:SubSystem
Performs enable actions for the subsystem. -
disable
public void disable()Description copied from interface:SubSystem
Performs disable actions for the subsystem -
getResourceFromJar
Get a file in the jar as aResource
.- Parameters:
resourceName
- Path to the file inside jar/assets/plan/ folder.- Returns:
- a
Resource
for accessing the resource.
-
getResourceFromPluginFolder
Get a file from plugin folder as aResource
.- Parameters:
resourceName
- Path to the file inside the plugin folder.- Returns:
- a
Resource
for accessing the resource.
-
getCustomizableResource
-
attemptToFind
-
getJSONStorageDirectory
-