srdo commented on a change in pull request #3091: STORM-3472: Add tests missing 
for STORM-3411, make the download file name generat…
URL: https://github.com/apache/storm/pull/3091#discussion_r307596943
 
 

 ##########
 File path: 
storm-webapp/src/main/java/org/apache/storm/daemon/logviewer/utils/LogviewerResponseBuilder.java
 ##########
 @@ -76,24 +76,18 @@ public static Response buildSuccessJsonResponse(Object 
entity, String callback,
      * Build a Response object representing download a file.
      *
      * @param host host address
+     * @param contentDispositionName The name to set in the 
Content-Disposition header
      * @param file file to download
      */
-    public static Response buildDownloadFile(String host, File file, Meter 
numFileDownloadExceptions) throws IOException {
-        String fname;
-        try {
-            String topoInfo = file.getParentFile().getParentFile().getName();
-            String port = file.getParentFile().getName();
-            fname = String.format("%s-%s-%s-%s", host, port, topoInfo, 
file.getName());
-        } catch (NullPointerException e) {
-            fname = file.getName();
-        }
+    public static Response buildDownloadFile(String host, String 
contentDispositionName,
 
 Review comment:
   Good catch, fixed

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to