Package com.codevasp.lazysodium.utils
Class FileLoader
java.lang.Object
com.codevasp.lazysodium.utils.ResourceLoader
com.codevasp.lazysodium.utils.FileLoader
-
Method Summary
Modifier and TypeMethodDescriptionstatic FileLoaderget()Get an instance of the loader.Load a file/directory from your resource folder using a relative path.load(String relativePath, Set<PosixFilePermission> permissions, Class outsideClass) Load a file/directory from your resource folder with permissions you set.Methods inherited from class com.codevasp.lazysodium.utils.ResourceLoader
copyToTempDirectory, createMainTempDirectory, extractFromWithinAJarFile, getThePathToTheJarWeAreIn, isPosixCompliant, requestDeletion, setPermissions, setPermissions, urlToFile, urlToFile
-
Method Details
-
get
Get an instance of the loader.- Returns:
- Returns this loader instantiated.
-
load
Load a file/directory from your resource folder using a relative path. This will return your file or directory with global read, write and execute.- Parameters:
relativePath- Relative path to your file or directory.- Returns:
- The file your directory.
- Throws:
IOException- If at any point processing of the resource file fails.URISyntaxException- If cannot find the resource file.
-
load
public File load(String relativePath, Set<PosixFilePermission> permissions, Class outsideClass) throws IOException, URISyntaxException Load a file/directory from your resource folder with permissions you set. On windows, any type of read, write and execute permissions will be set appropriately.- Parameters:
relativePath- Relative path to your file or directory.permissions- A set of permissions.- Returns:
- The file your directory.
- Throws:
IOException- If at any point processing of the resource file fails.URISyntaxException- If cannot find the resource file.
-