Package io.slifer.csv

Class CsvLoader


  • public class CsvLoader
    extends Object
    The CsvLoader performs the sole task of reading a CSV file from the classpath and loading a CsvFile instance that represents the contents of the file.
    Author:
    Tim Slifer
    • Constructor Detail

      • CsvLoader

        public CsvLoader()
    • Method Detail

      • load

        public static CsvFile load​(String fileName,
                                   boolean preserveSpaces)
        Loads the CSV file from resources and imports CSV content.
        Parameters:
        fileName - The path to and name of the CSV file to be loaded, relative to the classpath.
        preserveSpaces - Boolean indicating whether or not each value of each row, including the header, is to be stripped of leading and trailing spaces.
        Returns:
        An instance of CsvFile containing the imported data.
      • load

        public static CsvFile load​(String fileName)
        Loads the CSV file from resources and imports CSV content. Overloaded method omits the `toStrip` argument for convenience, thus retaining the original CSV data.
        Parameters:
        fileName - The path to and name of the CSV file to be loaded, relative to the classpath.
        Returns:
        An instance of CsvFile containing the imported data.