Class 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 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.