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
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPlanFiles(File dataFolder, JarResource.StreamFunction getResourceStream, dagger.Lazy<AssetVersions> assetVersions) -
Method Summary
Modifier and TypeMethodDescriptionattemptToFind(Path dir, String resourceName) voiddisable()Performs disable actions for the subsystemvoidenable()Performs enable actions for the subsystem.protected @NotNull LonggetLastModifiedForJarResource(String resourceName) getResourceFromJar(String resourceName) Get a file in the jar as aResource.getResourceFromPluginFolder(String resourceName) Get a file from plugin folder as aResource.static OpenOption[]
-
Field Details
-
getResourceStream
-
-
Constructor Details
-
PlanFiles
@Inject public PlanFiles(@Named("dataFolder") File dataFolder, JarResource.StreamFunction getResourceStream, dagger.Lazy<AssetVersions> assetVersions)
-
-
Method Details
-
getDataFolder
-
getDataDirectory
-
getLogsFolder
-
getLogsDirectory
-
getConfigFile
-
getLocaleFile
-
getFileFromPluginFolder
-
enable
public void enable()Description copied from interface:SubSystemPerforms enable actions for the subsystem. -
disable
public void disable()Description copied from interface:SubSystemPerforms 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
Resourcefor accessing the resource.
-
getLastModifiedForJarResource
-
getResourceFromPluginFolder
Get a file from plugin folder as aResource.- Parameters:
resourceName- Path to the file inside the plugin folder.- Returns:
- a
Resourcefor accessing the resource.
-
attemptToFind
-
getJSONStorageDirectory
-
replaceIfExists
-
getThemeDirectory
-