public interface FileImportProcessor
The main interface responsible for actually parsing a file. This is usually invoked from the ImportService
in
order to process the file.
CSVFileImportProcessor}
Modifier and Type | Method and Description |
---|---|
int |
calculateTotalRecords(File uploadedFile)
Given an InputStream, the implementation should calculate the total number of records to be processed.
|
boolean |
canHandle(File uploadedFile,
ImportSpecification importSpecification,
ImportType importType)
Whether or not this can handle the given input according to the
ImportSpecification |
void |
processFile(File uploadedFile,
Long processId,
ImportContext context)
This is designed to process and parse out a given uploadedFile and persist the records to the database.
|
void processFile(File uploadedFile, Long processId, ImportContext context) throws ImportException
uploadedFile
- the original file that was uploaded by the userprocess
- the process that was createdImportException
- if there was a problem in processing the inputStreamboolean canHandle(File uploadedFile, ImportSpecification importSpecification, ImportType importType)
ImportSpecification
uploadedFile
- the file that was uploaded by the userimportSpecification
- the metadata about uploadedFile in order to determine if it should be processedint calculateTotalRecords(File uploadedFile) throws ImportException
ImportException
- if there was a problem in processing the uploadedFileCopyright © 2020. All rights reserved.