Search in sources :

Example 1 with EntryProteinExistenceReportWriter

use of org.nextprot.api.core.service.export.EntryProteinExistenceReportWriter in project nextprot-api by calipho-sib.

the class ExportController method exportAllEntryProteinExistencess.

@RequestMapping(value = "/export/entry/all/protein-existences", method = { RequestMethod.GET }, produces = { NextprotMediaType.TSV_MEDIATYPE_VALUE })
public void exportAllEntryProteinExistencess(HttpServletResponse response) {
    try {
        EntryProteinExistenceReportWriter writer = new EntryProteinExistenceReportTSVWriter(response.getOutputStream());
        masterIdentifierService.findUniqueNames().forEach(entryAccession -> writer.write(entryAccession, overviewService.findOverviewByEntry(entryAccession).getProteinExistences()));
        writer.close();
    } catch (IOException e) {
        throw new NextProtException("cannot export all entries in TSV format", e);
    }
}
Also used : NextProtException(org.nextprot.api.commons.exception.NextProtException) EntryProteinExistenceReportTSVWriter(org.nextprot.api.core.service.export.io.EntryProteinExistenceReportTSVWriter) EntryProteinExistenceReportWriter(org.nextprot.api.core.service.export.EntryProteinExistenceReportWriter) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)1 NextProtException (org.nextprot.api.commons.exception.NextProtException)1 EntryProteinExistenceReportWriter (org.nextprot.api.core.service.export.EntryProteinExistenceReportWriter)1 EntryProteinExistenceReportTSVWriter (org.nextprot.api.core.service.export.io.EntryProteinExistenceReportTSVWriter)1