Package io.slifer.csv
Class CsvLoader
- java.lang.Object
-
- io.slifer.csv.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 Summary
Constructors Constructor Description CsvLoader()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static CsvFileload(String fileName)Loads the CSV file from resources and imports CSV content.static CsvFileload(String fileName, boolean preserveSpaces)Loads the CSV file from resources and imports CSV content.
-
-
-
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.
-
-