Class NihmsCsvProcessor

java.lang.Object
org.eclipse.pass.loader.nihms.NihmsCsvProcessor

public class NihmsCsvProcessor extends Object
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 Details

    • NihmsCsvProcessor

      public NihmsCsvProcessor(Path filePath, NihmsStatus status)
      Set the file path to the NIHMS CSV to read in and the status of the NIHMS deposit
      Parameters:
      filePath - path to NIHMS CSV
      status - status of NIHMS deposit
  • Method Details

    • processCsv

      public void processCsv(Consumer<NihmsPublication> pubConsumer)
      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

      public static NihmsStatus nihmsStatus(Path path)
      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