Package com.logicaldoc.util.csv
Class CSVFileWriter
java.lang.Object
com.logicaldoc.util.csv.CSVFile
com.logicaldoc.util.csv.CSVFileWriter
- All Implemented Interfaces:
- Closeable,- AutoCloseable
CSVFileWriter is a class derived from CSVFile used to format some fields into
 a new CSV file.
- Version:
- %I%, %G%
- Author:
- Fabrizio Fazzino
- 
Constructor SummaryConstructorsConstructorDescriptionCSVFileWriter(String outputFileName) CSVFileWriter constructor just need the name of the CSV file that will be written.CSVFileWriter(String outputFileName, boolean append) CSVFileWriter constructor just need the name of the CSV file that will be written.CSVFileWriter(String outputFileName, char sep) CSVFileWriter constructor with a given field separator.CSVFileWriter(String outputFileName, char sep, boolean append) CSVFileWriter constructor with a given field separator.CSVFileWriter(String outputFileName, char sep, char qual) CSVFileWriter constructor with given field separator and text qualifier.CSVFileWriter(String outputFileName, char sep, char qual, boolean append) CSVFileWriter constructor with given field separator and text qualifier.
- 
Method SummaryModifier and TypeMethodDescriptionvoidclose()Close the output CSV file.voidwriteFields(List<String> fields) Join the fields and write them as a new line to the CSV file.Methods inherited from class com.logicaldoc.util.csv.CSVFilegetFieldSeparator, getTextQualifier, setFieldSeparator, setTextQualifier
- 
Constructor Details- 
CSVFileWriterCSVFileWriter constructor just need the name of the CSV file that will be written.- Parameters:
- outputFileName- The name of the CSV file to be opened for writing
- Throws:
- IOException- If an error occurs while creating the file
 
- 
CSVFileWriterCSVFileWriter constructor with a given field separator.- Parameters:
- outputFileName- The name of the CSV file to be opened for reading
- sep- The field separator to be used; overwrites the default one
- Throws:
- IOException- If an error occurs while creating the file
 
- 
CSVFileWriterCSVFileWriter constructor with given field separator and text qualifier.- Parameters:
- outputFileName- The name of the CSV file to be opened for reading
- sep- The field separator to be used; overwrites the default one
- qual- The text qualifier to be used; overwrites the default one
- Throws:
- IOException- If an error occurs while creating the file
 
- 
CSVFileWriterCSVFileWriter constructor just need the name of the CSV file that will be written.- Parameters:
- outputFileName- The name of the CSV file to be opened for writing
- append- True if rows must be appended
- Throws:
- IOException- If an error occurs while creating the file
 
- 
CSVFileWriterCSVFileWriter constructor with a given field separator.- Parameters:
- outputFileName- The name of the CSV file to be opened for reading
- sep- The field separator to be used; overwrites the default one
- append- True if rows must be appended
- Throws:
- IOException- If an error occurs while creating the file
 
- 
CSVFileWriterCSVFileWriter constructor with given field separator and text qualifier.- Parameters:
- outputFileName- The name of the CSV file to be opened for reading
- sep- The field separator to be used; overwrites the default one
- qual- The text qualifier to be used; overwrites the default one
- append- True if rows must be appended
- Throws:
- IOException- If an error occurs while creating the file
 
 
- 
- 
Method Details- 
closeClose the output CSV file.- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Throws:
- IOException- If an error occurs while closing the file
 
- 
writeFieldsJoin the fields and write them as a new line to the CSV file.- Parameters:
- fields- The vector of strings containing the fields
 
 
-