Class ReadFile

java.lang.Object
fr.formiko.usuel.ReadFile

public class ReadFile extends Object
A tool class to read a file.
File can be read as a single Strings, as a List, as a String[] or as a GString.
Author:
Hydrolien
  • Constructor Details

    • ReadFile

      public ReadFile()
  • Method Details

    • readFile

      public static String readFile(File file)
      Read a file & return it as a String.
      Parameters:
      file - file to read
    • readFile

      public static String readFile(String fileName)
      Read a file & return it as a String.
      Parameters:
      fileName - name of the file to read
    • readFile

      public static String readFile(Path path)
      Read a file & return it as a String.
      Parameters:
      path - path to get the file
    • readFileArray

      public static String[] readFileArray(String fileName)
      Read a file & return it as an array.
      Parameters:
      fileName - name of the file to read
    • readFileList

      public static List<String> readFileList(File file)
      Read a file & return it as a List.
      Parameters:
      file - file to read
    • readFileList

      public static List<String> readFileList(String fileName)
      Read a file & return it as a List.
      Parameters:
      fileName - name of the file to read
    • readFileList

      public static List<String> readFileList(Path path)
      Read a file & return it as a List.
      Parameters:
      path - path to get the file
    • readFileGs

      public static GString readFileGs(File file)
      Read a file & return it as a GString.
      Parameters:
      file - file to read
    • readFileGs

      public static GString readFileGs(String fileName)
      Read a file & return it as a GString.
      Parameters:
      fileName - name of the file to read
    • readFileGs

      public static GString readFileGs(Path path)
      Read a file & return it as a GString.
      Parameters:
      path - path to get the file