public class CSVFileUtil extends Object
Modifier and Type | Field and Description |
---|---|
protected static org.slf4j.Logger |
logger |
Constructor and Description |
---|
CSVFileUtil() |
Modifier and Type | Method and Description |
---|---|
static ArrayList<CSVRowError> |
checkCSV(File csvFile,
Charset charset,
char delimiter,
char comment,
long errorsLimit) |
static ArrayList<CSVRowError> |
checkCSV(File csvFile,
CSVParserConfiguration config,
long errorsLimit) |
protected static net.sf.csv4j.CSVReader |
createCSVReader(File csvFile,
CSVParserConfiguration parserConfiguration) |
static List<String> |
getFirstLine(net.sf.csv4j.CSVReader csvReader,
boolean includeComment) |
static ArrayList<String> |
getHeader(File csvFile,
CSVParserConfiguration parserConfiguration) |
static String |
guessEncoding(File file) |
static void |
toJson(File csvFile,
Charset inputCharset,
File outputFile,
Charset outputCharset,
HeaderPresence headerPresence,
char delimiter,
char comment,
long limit) |
static void |
toJson(InputStream csv,
Charset inputCharset,
OutputStream output,
Charset outputCharset,
HeaderPresence headerPresence,
char delimiter,
char comment,
long limit) |
static void |
toJson(InputStream csv,
OutputStream output,
Charset outputCharset,
CSVParserConfiguration config,
long limit) |
public static ArrayList<String> getHeader(File csvFile, CSVParserConfiguration parserConfiguration) throws net.sf.csv4j.ParseException, IOException
net.sf.csv4j.ParseException
IOException
public static List<String> getFirstLine(net.sf.csv4j.CSVReader csvReader, boolean includeComment) throws net.sf.csv4j.ParseException, IOException
net.sf.csv4j.ParseException
IOException
protected static net.sf.csv4j.CSVReader createCSVReader(File csvFile, CSVParserConfiguration parserConfiguration) throws FileNotFoundException
FileNotFoundException
public static ArrayList<CSVRowError> checkCSV(File csvFile, CSVParserConfiguration config, long errorsLimit) throws net.sf.csv4j.ParseException, IOException
net.sf.csv4j.ParseException
IOException
public static ArrayList<CSVRowError> checkCSV(File csvFile, Charset charset, char delimiter, char comment, long errorsLimit) throws IOException
IOException
public static void toJson(File csvFile, Charset inputCharset, File outputFile, Charset outputCharset, HeaderPresence headerPresence, char delimiter, char comment, long limit) throws net.sf.csv4j.ParseException, IOException
net.sf.csv4j.ParseException
IOException
public static void toJson(InputStream csv, OutputStream output, Charset outputCharset, CSVParserConfiguration config, long limit) throws net.sf.csv4j.ParseException, IOException
net.sf.csv4j.ParseException
IOException
public static void toJson(InputStream csv, Charset inputCharset, OutputStream output, Charset outputCharset, HeaderPresence headerPresence, char delimiter, char comment, long limit) throws net.sf.csv4j.ParseException, IOException
net.sf.csv4j.ParseException
IOException
public static String guessEncoding(File file) throws IOException
IOException
Copyright © 2014. All Rights Reserved.