public class CSVImportSource extends Object implements IImportSource
Constructor and Description |
---|
CSVImportSource(org.apache.commons.fileupload.FileItem fileItem,
String strCSVSeparator,
String strCSVQuoteChar)
Creates a new CSVImportSource from a file uploaded by the user
|
CSVImportSource(File file,
String strCSVSeparator,
String strCSVQuoteChar)
Creates a new CSVImportSource from a file of the server
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the data source
|
protected void |
finalize() |
List<String> |
getColumnsName()
Get the name of columns of this data source
|
List<ImportExportElement> |
getNextValues()
Get the next set of values, or null if this data source has no more
values.
|
public CSVImportSource(org.apache.commons.fileupload.FileItem fileItem, String strCSVSeparator, String strCSVQuoteChar)
fileItem
- The CSV file to read data from. The first line of the CSV
file must contain the names of columns of the databasestrCSVSeparator
- The CSV separator to use. If it is null or empty,
then the default CSV separator is used (which is ",")strCSVQuoteChar
- The CSV quote character to use. If it is null or
empty, then the default CSV quote character is used (which is
"\"")public CSVImportSource(File file, String strCSVSeparator, String strCSVQuoteChar)
file
- The CSV file to read data from. The first line of the CSV
file must contain the names of columns of the databasestrCSVSeparator
- The CSV separator to use. If it is null or empty,
then the default CSV separator is used (which is ",")strCSVQuoteChar
- The CSV quote character to use. If it is null or
empty, then the default CSV quote character is used (which is
"\"")public List<ImportExportElement> getNextValues()
getNextValues
in interface IImportSource
public List<String> getColumnsName()
getColumnsName
in interface IImportSource
public void close()
close
in interface IImportSource
Copyright © 2018 City of Paris. All rights reserved.