From d5a6a0da151c66b4a0d92514596f753f64b5181f Mon Sep 17 00:00:00 2001 From: Victor Harbo Johnston Date: Wed, 9 Aug 2023 08:58:05 +0200 Subject: [PATCH] Update zip filename construction --- .../solrwayback/service/SolrWaybackResource.java | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/main/java/dk/kb/netarchivesuite/solrwayback/service/SolrWaybackResource.java b/src/main/java/dk/kb/netarchivesuite/solrwayback/service/SolrWaybackResource.java index 2fb8b8da..58a87808 100644 --- a/src/main/java/dk/kb/netarchivesuite/solrwayback/service/SolrWaybackResource.java +++ b/src/main/java/dk/kb/netarchivesuite/solrwayback/service/SolrWaybackResource.java @@ -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)