Interface FileSource
- All Superinterfaces:
MetadataSource
- All Known Implementing Classes:
AbstractPlainMetadataSource,BibtexImportMetadataSourceServiceImpl,CharacterSeparatedImportMetadataSourceServiceImpl,EndnoteImportMetadataSourceServiceImpl,PubmedImportMetadataSourceServiceImpl,RisImportMetadataSourceServiceImpl
This interface declare the base methods to work with files containing metadata.
- Author:
- Pasquale Cavallo (pasquale.cavallo at 4science dot it)
-
Method Summary
Modifier and TypeMethodDescriptiongetRecord(InputStream inputStream) Return an ImportRecord constructed from input file.getRecords(InputStream inputStream) Return a list of ImportRecord constructed from input file.Get the file extensions (xml, csv, txt, ...) supported by the FileSourcedefault booleanisValidSourceForFile(String originalName) This method is used to decide if the FileSource manage the file formatMethods inherited from interface org.dspace.importer.external.service.components.MetadataSource
getImportSource
-
Method Details
-
getSupportedExtensions
Get the file extensions (xml, csv, txt, ...) supported by the FileSource -
getRecords
Return a list of ImportRecord constructed from input file.- Parameters:
inputStream- The inputStream of the file- Returns:
- A list of
ImportRecord - Throws:
FileSourceException- if, for any reason, the file is not parsable
-
getRecord
ImportRecord getRecord(InputStream inputStream) throws FileSourceException, FileMultipleOccurencesException Return an ImportRecord constructed from input file.- Parameters:
inputStream- The inputStream of the file- Returns:
- An
ImportRecordmatching the file content - Throws:
FileSourceException- if, for any reason, the file is not parsableFileMultipleOccurencesException- if the file contains more than one entry
-
isValidSourceForFile
This method is used to decide if the FileSource manage the file format- Parameters:
originalName- the file file original name- Returns:
- true if the FileSource can parse the file, false otherwise
-