Skip to content

Commit

Permalink
Update zip filename construction
Browse files Browse the repository at this point in the history
  • Loading branch information
VictorHarbo authored and tokee committed Aug 9, 2023
1 parent 529d2cb commit d5a6a0d
Showing 1 changed file with 1 addition and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -464,25 +464,12 @@ public Response exportZipContent(@QueryParam("query") String query, @QueryParam(

StreamingOutput zip = Facade.exportZipContent(query, filters);

String filename = createZipFilename();

return Response.ok(zip)
.header("Content-Disposition", "attachment; filename=" + filename)
.header("Content-Disposition", getDisposition("solrwayback_$DATETIME_export.zip"))
.build();

}

/**
* Create name for zip file. The name includes information on the exported mimetype and the time for the export.
* @return the filename in the format datetime_export.zip
*/
private String createZipFilename() {
Date date = new Date() ;
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");

return dateFormat.format(date) + "_export.zip";
}


/*
// * This will be called from solrwayback page views, when resources can not be resolved (not harvested)
Expand Down

0 comments on commit d5a6a0d

Please sign in to comment.