Class CSVReaderBuilder


  • public class CSVReaderBuilder
    extends Object
    This class is responsible to build a reader first guessing the configuration from the file it self and then, if not successful, from the DefaultConfiguration.
    Author:
    Davide Palmisano ( dpalmisano@gmail.com ), Michele Mostarda ( michele.mostarda@gmail.com )
    • Constructor Detail

      • CSVReaderBuilder

        public CSVReaderBuilder()
    • Method Detail

      • build

        public static org.apache.commons.csv.CSVParser build​(InputStream is)
                                                      throws IOException
        Builds a not null CSVParser guessing from the provided CSV file.
        Parameters:
        is - InputStream of the CSV file where guess the configuration.
        Returns:
        a CSVParser
        Throws:
        IOException - if there is an error building the parser
      • isCSV

        public static boolean isCSV​(InputStream is)
                             throws IOException
        Checks whether the given input stream is a CSV or not.
        Parameters:
        is - input stream to be verified.
        Returns:
        true if the given is input stream contains a CSV content. false otherwise.
        Throws:
        IOException - if there is an error processing the input stream