public abstract class CSVReaderService extends Object
Constructor and Description |
---|
CSVReaderService() |
Modifier and Type | Method and Description |
---|---|
Character |
getCSVEscapeCharacter()
Get the escape character used for CSV files.
|
Character |
getCSVSeparator()
Get the separator used for CSV files.
|
static Character |
getDefaultCSVEscapeCharacter()
Get the default CSV escape character to use.
|
static Character |
getDefaultCSVSeparator()
Get the default CSV separator to use.
|
List<CSVMessageDescriptor> |
readCSVFile(File file,
int nColumnNumber,
boolean bCheckFileBeforeProcessing,
boolean bExitOnError,
boolean bSkipFirstLine,
Locale locale,
String strBaseUrl)
Read a CSV file and call the method
readLineOfCSVFile for each of its lines. |
List<CSVMessageDescriptor> |
readCSVFile(org.apache.commons.fileupload.FileItem fileItem,
int nColumnNumber,
boolean bCheckFileBeforeProcessing,
boolean bExitOnError,
boolean bSkipFirstLine,
Locale locale,
String strBaseUrl)
Read a CSV file and call the method
readLineOfCSVFile for each of its lines. |
List<CSVMessageDescriptor> |
readCSVFile(PhysicalFile physicalFile,
int nColumnNumber,
boolean bCheckFileBeforeProcessing,
boolean bExitOnError,
boolean bSkipFirstLine,
Locale locale,
String strBaseUrl)
Read a CSV file and call the method
readLineOfCSVFile for each of its lines. |
List<CSVMessageDescriptor> |
readCSVFile(String strPath,
int nColumnNumber,
boolean bCheckFileBeforeProcessing,
boolean bExitOnError,
boolean bSkipFirstLine,
Locale locale,
String strBaseUrl)
Read a CSV file and call the method
readLineOfCSVFile for each of its lines. |
void |
setCSVEscapeCharacter(Character strCSVEscapeCharacter)
Set the escape character to use for CSV files.
|
void |
setCSVSeparator(Character strCSVSeparator)
Set the separator to use for CSV files.
|
public static Character getDefaultCSVSeparator()
public static Character getDefaultCSVEscapeCharacter()
public List<CSVMessageDescriptor> readCSVFile(org.apache.commons.fileupload.FileItem fileItem, int nColumnNumber, boolean bCheckFileBeforeProcessing, boolean bExitOnError, boolean bSkipFirstLine, Locale locale, String strBaseUrl)
readLineOfCSVFile
for each of its lines.fileItem
- FileItem to get the CSV file from. If the creation of the input stream associated to this file throws a IOException, then an error is returned
and the file is not red.nColumnNumber
- Number of columns of each lines. Use 0 to skip column number check (for example if every lines don't have the same number of columns)bCheckFileBeforeProcessing
- Indicates if the file should be check before processing any of its line. If it is set to true, then then no line is processed if the file has
any error.bExitOnError
- Indicates if the processing of the CSV file should end on the first error, or at the end of the file.bSkipFirstLine
- Indicates if the first line of the file should be skipped or not.locale
- the localestrBaseUrl
- The base URLCSVMessageDescriptor.compareTo(CSVMessageDescriptor) for information about sort
public List<CSVMessageDescriptor> readCSVFile(String strPath, int nColumnNumber, boolean bCheckFileBeforeProcessing, boolean bExitOnError, boolean bSkipFirstLine, Locale locale, String strBaseUrl)
readLineOfCSVFile
for each of its lines.strPath
- Path if the file to read in the file system.nColumnNumber
- Number of columns of each lines. Use 0 to skip column number check (for example if every lines don't have the same number of columns)bCheckFileBeforeProcessing
- Indicates if the file should be check before processing any of its line. If it is set to true, then then no line is processed if the file has
any error.bExitOnError
- Indicates if the processing of the CSV file should end on the first error, or at the end of the file.bSkipFirstLine
- Indicates if the first line of the file should be skipped or not.locale
- the localestrBaseUrl
- The base URLCSVMessageDescriptor.compareTo(CSVMessageDescriptor) for information about sort
public List<CSVMessageDescriptor> readCSVFile(File file, int nColumnNumber, boolean bCheckFileBeforeProcessing, boolean bExitOnError, boolean bSkipFirstLine, Locale locale, String strBaseUrl)
readLineOfCSVFile
for each of its lines.file
- File to get the values from. If the physical file of this file has no value, then it is gotten from the database.nColumnNumber
- Number of columns of each lines. Use 0 to skip column number check (for example if every lines don't have the same number of columns)bCheckFileBeforeProcessing
- Indicates if the file should be check before processing any of its line. If it is set to true, then then no line is processed if the file has
any error.bExitOnError
- Indicates if the processing of the CSV file should end on the first error, or at the end of the file.bSkipFirstLine
- Indicates if the first line of the file should be skipped or not.locale
- the localestrBaseUrl
- The base URLCSVMessageDescriptor.compareTo(CSVMessageDescriptor) for information about sort
public List<CSVMessageDescriptor> readCSVFile(PhysicalFile physicalFile, int nColumnNumber, boolean bCheckFileBeforeProcessing, boolean bExitOnError, boolean bSkipFirstLine, Locale locale, String strBaseUrl)
readLineOfCSVFile
for each of its lines.physicalFile
- The physicalFile to get the values from. If the physical file has no value, then it is gotten from the database.nColumnNumber
- Number of columns of each lines. Use 0 to skip column number check (for example if every lines don't have the same number of columns)bCheckFileBeforeProcessing
- Indicates if the file should be check before processing any of its line. If it is set to true, then then no line is processed if the file has
any error.bExitOnError
- Indicates if the processing of the CSV file should end on the first error, or at the end of the file.bSkipFirstLine
- Indicates if the first line of the file should be skipped or not.locale
- the localestrBaseUrl
- The base URLCSVMessageDescriptor.compareTo(CSVMessageDescriptor) for information about sort
public Character getCSVSeparator()
public void setCSVSeparator(Character strCSVSeparator)
strCSVSeparator
- The separator to use for CSV files.public Character getCSVEscapeCharacter()
public void setCSVEscapeCharacter(Character strCSVEscapeCharacter)
strCSVEscapeCharacter
- The escape character to use for CSV files.Copyright © 2020 City of Paris. All rights reserved.