Class CabReader
java.lang.Object
org.genesys.taxonomy.gringlobal.component.CabReader
The helper class to read USDA-published CAB data.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDate format used in the Taxonomy CSVs: 2000-12-08 00:00:00. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> com.opencsv.bean.CsvToBean<T>beanReader(Class<T> clazz, com.opencsv.CSVReader reader) Bean reader.static InputStreamReaderbomSafeReader(InputStream inputStream) Handle BOM marker in CSV files.static com.opencsv.CSVReaderopenCsvReader(InputStream inputStream, int startAt) Returns aCSVReaderthat properly handles GRIN-Global taxonomy files in CSV format.
-
Field Details
-
CSV_DATE_FORMAT
Date format used in the Taxonomy CSVs: 2000-12-08 00:00:00.- See Also:
-
-
Constructor Details
-
CabReader
public CabReader()
-
-
Method Details
-
bomSafeReader
Handle BOM marker in CSV files.- Parameters:
inputStream- the input stream- Returns:
- a BOM-safe input stream
- Throws:
IOException- if reading fails
-
beanReader
public static <T> com.opencsv.bean.CsvToBean<T> beanReader(Class<T> clazz, com.opencsv.CSVReader reader) Bean reader.- Type Parameters:
T- the generic type- Parameters:
clazz- the clazzreader- the reader- Returns:
- the csv to bean
-
openCsvReader
public static com.opencsv.CSVReader openCsvReader(InputStream inputStream, int startAt) throws IOException Returns aCSVReaderthat properly handles GRIN-Global taxonomy files in CSV format. It converts \N tonullin each row.- Parameters:
inputStream- the input streamstartAt- the start row- Returns:
- the CSV reader
- Throws:
IOException- I/O exception
-