Package org.eclipse.pass.loader.nihms
Class NihmsCsvProcessor
java.lang.Object
org.eclipse.pass.loader.nihms.NihmsCsvProcessor
NIHMS CSV Reader expects a Submissions CSV from the NIHMS site and will read it into a List,
mapping the relevant fields to the NihmsPublication model.
- Version:
- $Id$
- Author:
- Karen Hanson
-
Constructor Summary
ConstructorsConstructorDescriptionNihmsCsvProcessor(Path filePath, NihmsStatus status) Set the file path to the NIHMS CSV to read in and the status of the NIHMS deposit -
Method Summary
Modifier and TypeMethodDescriptionstatic NihmsStatusnihmsStatus(Path path) Cycles through Submission status types, and matches it to the filepath to determine the status of the rows in the CSV file.voidprocessCsv(Consumer<NihmsPublication> pubConsumer) Cycles through the CSV that is loaded, converting to a NihmsPublication, and then using the consumer provided to process the record
-
Constructor Details
-
NihmsCsvProcessor
Set the file path to the NIHMS CSV to read in and the status of the NIHMS deposit- Parameters:
filePath- path to NIHMS CSVstatus- status of NIHMS deposit
-
-
Method Details
-
processCsv
Cycles through the CSV that is loaded, converting to a NihmsPublication, and then using the consumer provided to process the record- Parameters:
pubConsumer- the consumer
-
nihmsStatus
Cycles through Submission status types, and matches it to the filepath to determine the status of the rows in the CSV file. If no match is found, an exception is thrown.- Parameters:
path- the file path- Returns:
- the status
- Throws:
RuntimeException- if the status could not be determined
-