Package org.dbunit.dataset.csv
Class CsvProducer
java.lang.Object
org.dbunit.dataset.csv.CsvProducer
- All Implemented Interfaces:
IDataSetProducer
IDataSetProducer that streams table and row events by parsing CSV files.- Since:
- 1.5 (Sep 17, 2003)
- Version:
- $Revision$ $Date$
- Author:
- Federico Spinazzi, Last changed by: $Author$
-
Constructor Summary
ConstructorsConstructorDescriptionCsvProducer(File theDirectory) Creates a producer that reads CSV files from the given directory.CsvProducer(String theDirectory) Creates a producer that reads CSV files from the given directory. -
Method Summary
Modifier and TypeMethodDescriptionstatic ListGet a list of tables that this producer will createvoidproduce()Process this dataset source.voidsetConsumer(IDataSetConsumer consumer) Sets the consumer notified of this producer's dataset content.
-
Constructor Details
-
CsvProducer
Creates a producer that reads CSV files from the given directory.- Parameters:
theDirectory- the path of the directory containing the CSV files.
-
CsvProducer
Creates a producer that reads CSV files from the given directory.- Parameters:
theDirectory- the directory containing the CSV files.
-
-
Method Details
-
setConsumer
Description copied from interface:IDataSetProducerSets the consumer notified of this producer's dataset content.- Specified by:
setConsumerin interfaceIDataSetProducer- Parameters:
consumer- the consumer to notify.- Throws:
DataSetException- if the consumer cannot be set.
-
produce
Process this dataset source. During the processing, the IDataSetProducer will provide information about the dataset through the specified event listener.This method is synchronous: it will not return until processing has ended. If a client application wants to terminate parsing early, it should throw an exception from the listener.
- Specified by:
producein interfaceIDataSetProducer- Throws:
DataSetException- if processing the dataset source fails.
-
getTables
Get a list of tables that this producer will create- Parameters:
base- the base URL the table list file is resolved against.tableList- the name of the file, relative to base, listing the tables in load order.- Returns:
- a list of Strings, where each item is a CSV file relative to the base URL
- Throws:
IOException- when IO on the base URL has issues.
-