Class UIMetadataFileImportService
- java.lang.Object
-
- ca.corefacility.bioinformatics.irida.ria.web.services.UIMetadataFileImportService
-
@Component public class UIMetadataFileImportService extends java.lang.Object
UI service to handle parsing metadata files so they can be saved to the session.
-
-
Constructor Summary
Constructors Constructor Description UIMetadataFileImportService(ProjectService projectService, SampleService sampleService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SampleMetadataStorage
parseCSV(java.lang.Long projectId, java.io.InputStream inputStream)
Parse metadata from an csv file.SampleMetadataStorage
parseExcel(java.lang.Long projectId, java.io.InputStream inputStream, java.lang.String extension)
Parse metadata from an excel file.
-
-
-
Constructor Detail
-
UIMetadataFileImportService
@Autowired public UIMetadataFileImportService(ProjectService projectService, SampleService sampleService)
-
-
Method Detail
-
parseCSV
public SampleMetadataStorage parseCSV(java.lang.Long projectId, java.io.InputStream inputStream) throws java.io.IOException
Parse metadata from an csv file.- Parameters:
projectId
-Long
The project identifier.inputStream
- The inputStream of the csv file.- Returns:
SampleMetadataStorage
contains the metadata from file.- Throws:
java.io.IOException
- thrown if the extension does not exist.
-
parseExcel
public SampleMetadataStorage parseExcel(java.lang.Long projectId, java.io.InputStream inputStream, java.lang.String extension) throws java.io.IOException
Parse metadata from an excel file.- Parameters:
projectId
-Long
The project identifier.inputStream
- The inputStream of the excel file.extension
- The extension of the excel file.- Returns:
SampleMetadataStorage
contains the metadata from file.- Throws:
java.io.IOException
- thrown if the extension does not exist.
-
-