Class CsvFileReader

java.lang.Object
be.personify.util.CsvFileReader

public class CsvFileReader extends Object
Author:
vanderw
  • Constructor Details

    • CsvFileReader

      public CsvFileReader()
  • Method Details

    • readCsvFile

      public static List<org.apache.commons.csv.CSVRecord> readCsvFile(Reader reader, String[] header) throws Exception
      Reads csv file with specified header
      Parameters:
      reader - that reads
      header - containing the header info
      Returns:
      a list containing the records
      Throws:
      Exception - with the stacktrace
    • readCsvFile

      public static List<org.apache.commons.csv.CSVRecord> readCsvFile(Reader reader, org.apache.commons.csv.CSVFormat csvFormat) throws Exception
      Reads the csvfile
      Parameters:
      reader - for reading
      csvFormat - the format used to read
      Returns:
      the list with the records
      Throws:
      Exception - with the stacktrace
    • readCsvFile

      public static List<org.apache.commons.csv.CSVRecord> readCsvFile(File file, String[] header) throws Exception
      Reads a csv file with the given header definition
      Parameters:
      file - containing the content
      header - containing header information
      Returns:
      a list containing the records
      Throws:
      Exception - with the stacktrace
    • readCsvFile

      public static List<org.apache.commons.csv.CSVRecord> readCsvFile(String filePath) throws Exception
      Throws:
      Exception