Class FileLoader

java.lang.Object
com.codevasp.lazysodium.utils.ResourceLoader
com.codevasp.lazysodium.utils.FileLoader

public class FileLoader extends ResourceLoader
  • Method Details

    • get

      public static FileLoader get()
      Get an instance of the loader.
      Returns:
      Returns this loader instantiated.
    • load

      public File load(String relativePath, Class outsideClass) throws IOException, URISyntaxException
      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.