use of uk.ac.bbsrc.tgac.miso.core.data.spreadsheet.SpreadSheetFormat in project miso-lims by miso-lims.
the class MisoWebUtils method generateSpreadsheet.
public static <T> HttpEntity<byte[]> generateSpreadsheet(SpreadsheetRequest request, Stream<T> input, boolean detailedSample, Function<String, Spreadsheet<T>> formatLibrary, HttpServletResponse response) {
Spreadsheet<T> spreadsheet = formatLibrary.apply(request.getSheet());
SpreadSheetFormat formatter = SpreadSheetFormat.valueOf(request.getFormat());
HttpHeaders headers = makeHttpHeaders(spreadsheet, formatter, response);
return new HttpEntity<>(formatter.generate(input, detailedSample, spreadsheet), headers);
}
Aggregations