Package com.jml.util

Class FileManager

java.lang.Object
com.jml.util.FileManager

public class FileManager extends Object
  • Method Details

    • stringToFile

      public static void stringToFile(String data, String filePath)
      Writes a string to a file.
      Parameters:
      data - Raw data to write to file.
      filePath - File path including file extension
    • readFile

      public static String readFile(String filePath)
      Reads content from a file.
      Parameters:
      filePath - File path including file extension of the file to load.
      Returns:
      Raw content of file.
    • readCSVtoString

      public static String[][] readCSVtoString(String filePath)
      Reads a CSV (comma seperated value) file into a 2D array of String.
      Parameters:
      filePath - File name including the extension. The extension must be .csv
      Returns:
      The CSV file contents as a 2D array of Strings
    • readCSVtoDouble

      public static double[][] readCSVtoDouble(String filePath)
      Reads a CSV (comma seperated value) file into a 2D array of doubles.
      Parameters:
      filePath - File name including the extension. The extension must be .csv
      Returns:
      The CSV file contents as a 2D array of doubles