File tree Expand file tree Collapse file tree 1 file changed +0
-19
lines changed
src/main/java/org/breedinginsight/brapi/v2 Expand file tree Collapse file tree 1 file changed +0
-19
lines changed Original file line number Diff line number Diff line change @@ -221,25 +221,6 @@ public HttpResponse<Response<DataResponse<List<BrAPIGermplasm>>>> getGermplasm(
221221 return HttpResponse .status (HttpStatus .UNPROCESSABLE_ENTITY , "Error parsing requested date format" );
222222 }
223223 }
224- @ Get ("/programs/{programId}/germplasm/lists/{listDbId}/export{?fileExtension}" )
225- @ Produces (value = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" )
226- @ ProgramSecured (roleGroups = {ProgramSecuredRoleGroup .PROGRAM_SCOPED_ROLES })
227- public HttpResponse <StreamedFile > germplasmListExport (
228- @ PathVariable ("programId" ) UUID programId , @ PathVariable ("listDbId" ) String listDbId , @ QueryValue (defaultValue = "XLSX" ) String fileExtension ) {
229- String downloadErrorMessage = "An error occurred while generating the download file. Contact the development team at bidevteam@cornell.edu." ;
230- try {
231- FileType extension = Enum .valueOf (FileType .class , fileExtension );
232- DownloadFile germplasmListFile = germplasmService .exportGermplasmList (programId , listDbId , extension );
233- HttpResponse <StreamedFile > germplasmListExport = HttpResponse .ok (germplasmListFile .getStreamedFile ()).header (HttpHeaders .CONTENT_DISPOSITION , "attachment;filename=" +germplasmListFile .getFileName ()+extension .getExtension ());
234- return germplasmListExport ;
235- }
236- catch (Exception e ) {
237- log .info (e .getMessage (), e );
238- e .printStackTrace ();
239- HttpResponse response = HttpResponse .status (HttpStatus .INTERNAL_SERVER_ERROR , downloadErrorMessage ).contentType (MediaType .TEXT_PLAIN ).body (downloadErrorMessage );
240- return response ;
241- }
242- }
243224
244225 @ Get ("/programs/{programId}/germplasm/lists/{listDbId}/export{?fileExtension}" )
245226 @ Produces (value = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" )
You can’t perform that action at this time.
0 commit comments