[ 
https://issues.apache.org/jira/browse/WICKET-6355?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15965569#comment-15965569
 ] 

ASF GitHub Bot commented on WICKET-6355:
----------------------------------------

Github user martin-g commented on a diff in the pull request:

    https://github.com/apache/wicket/pull/219#discussion_r111096456
  
    --- Diff: 
wicket-core/src/main/java/org/apache/wicket/resource/FileSystemResource.java ---
    @@ -68,17 +68,19 @@ public FileSystemResource()
        @Override
        protected ResourceResponse newResourceResponse(Attributes attributes)
        {
    -           return createResourceResponse(path);
    +           return createResourceResponse(path, null);
        }
     
        /**
         * Creates a resource response based on the given attributes
         * 
         * @param path
         *            the path to create the resource response with
    +    * @param fileName
    +    *            fileName to set, path.getFileName() will be used in case 
null passed
         * @return the actual resource response x
         */
    -   protected ResourceResponse createResourceResponse(Path path)
    +   protected ResourceResponse createResourceResponse(Path path, String 
fileName)
    --- End diff --
    
    Do we really need this extra parameter here for the fileName ?
    IMO by default it should do: `if (fileName != null) 
resourceResponse.setFileName(path.getFileName().toString());`
    If the application wants to override it then do something like:
    ```java
    ResourceResponse rr = super.createResourceResponse(path);
    rr.setFileName("custom.name");
    return rr;
    ```
    
    Also I think passing `Attributes` as a parameter would be useful!


> There should be possible to set fileName to FileSystemResource
> --------------------------------------------------------------
>
>                 Key: WICKET-6355
>                 URL: https://issues.apache.org/jira/browse/WICKET-6355
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 8.0.0-M5
>            Reporter: Maxim Solodovnik
>            Priority: Minor
>
> Currently no fileName is set to FileSystemResource, and there is no easy way 
> to do it



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to