Class FileUtil

java.lang.Object
com.github.toolarium.security.util.FileUtil

public final class FileUtil extends Object
File Util class
  • Method Details

    • getInstance

      public static FileUtil getInstance()
      Get the instance
      Returns:
      the instance
    • readFileContent

      public String readFileContent(File file) throws IOException
      Read the file content
      Parameters:
      file - the file
      Returns:
      the content
      Throws:
      IOException - In case of an IO error
    • readFileContent

      public String readFileContent(Path file) throws IOException
      Read the file content
      Parameters:
      file - the file
      Returns:
      the content
      Throws:
      IOException - In case of an IO error
    • readFileContent

      public String readFileContent(File file, Charset charset) throws IOException
      Read the file content
      Parameters:
      file - the file
      charset - the charset
      Returns:
      the content
      Throws:
      IOException - In case of an IO error
    • readFileContent

      public String readFileContent(Path file, Charset charset) throws IOException
      Read the file content
      Parameters:
      file - the file
      charset - the charset
      Returns:
      the content
      Throws:
      IOException - In case of an IO error