You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Maxim Solodovnik <so...@gmail.com> on 2017/04/12 05:45:56 UTC

Setting file name for FileSystemResource

Hello Tobias,

I'm trying to use FileSystemResource in latest wicket AjaxDownload
Unfortunately I see no easy way to set filename :(

It seems not to be taken from the Path passed ...
Could you please tell me how to do it?

-- 
WBR
Maxim aka solomax

Re: Setting file name for FileSystemResource

Posted by Maxim Solodovnik <so...@gmail.com>.
https://issues.apache.org/jira/browse/WICKET-6355
https://github.com/apache/wicket/pull/219

On Wed, Apr 12, 2017 at 2:55 PM, Maxim Solodovnik <so...@gmail.com>
wrote:

> Will try to
> Will write back here
>
> On Wed, Apr 12, 2017 at 2:44 PM, Tobias Soloschenko <
> tobiassoloschenko@googlemail.com> wrote:
>
>> Hi,
>>
>> I am very sorry that I am bussy at the moment. Are you able to create a
>> PR for that. I review it as soon as possible.
>>
>> kind regards
>>
>> Tobias
>>
>> > Am 12.04.2017 um 08:30 schrieb Maxim Solodovnik <so...@gmail.com>:
>> >
>> > I would use file name from the Path by default
>> > And the ability to pass different name is also good idea
>> >
>> > On Wed, Apr 12, 2017 at 1:28 PM, Tobias Soloschenko <
>> > tobiassoloschenko@googlemail.com> wrote:
>> >
>> >> Hi,
>> >>
>> >> maybe we could add a callback method to add the name or a second
>> >> parameter, because in case of a FileSystemResource this might me a
>> usual
>> >> scenario.
>> >>
>> >> WDYT?
>> >>
>> >> kind regards
>> >>
>> >> Tobias
>> >>
>> >>> Am 12.04.2017 um 08:25 schrieb Sven Meier <sv...@meiers.net>:
>> >>>
>> >>> Hi Maxim,
>> >>>
>> >>> FIleSystemResource does not support a file name by default, you have
>> to
>> >> add it yourself:
>> >>>
>> >>> protected ResourceResponse createResourceResponse(Path path) {
>> >>>   ResourceResponse response = super.createResourceResponse(path);
>> >>>   response.setFileName(path.getFileName());
>> >>>   return response;
>> >>> }
>> >>>
>> >>> Regards
>> >>> Sven
>> >>>
>> >>>
>> >>>> On 12.04.2017 07:45, Maxim Solodovnik wrote:
>> >>>> Hello Tobias,
>> >>>>
>> >>>> I'm trying to use FileSystemResource in latest wicket AjaxDownload
>> >>>> Unfortunately I see no easy way to set filename :(
>> >>>>
>> >>>> It seems not to be taken from the Path passed ...
>> >>>> Could you please tell me how to do it?
>> >>>>
>> >>>
>> >>>
>> >>> ---------------------------------------------------------------------
>> >>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> >>> For additional commands, e-mail: users-help@wicket.apache.org
>> >>>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> >> For additional commands, e-mail: users-help@wicket.apache.org
>> >>
>> >>
>> >
>> >
>> > --
>> > WBR
>> > Maxim aka solomax
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
>
> --
> WBR
> Maxim aka solomax
>



-- 
WBR
Maxim aka solomax

Re: Setting file name for FileSystemResource

Posted by Maxim Solodovnik <so...@gmail.com>.
Will try to
Will write back here

On Wed, Apr 12, 2017 at 2:44 PM, Tobias Soloschenko <
tobiassoloschenko@googlemail.com> wrote:

> Hi,
>
> I am very sorry that I am bussy at the moment. Are you able to create a PR
> for that. I review it as soon as possible.
>
> kind regards
>
> Tobias
>
> > Am 12.04.2017 um 08:30 schrieb Maxim Solodovnik <so...@gmail.com>:
> >
> > I would use file name from the Path by default
> > And the ability to pass different name is also good idea
> >
> > On Wed, Apr 12, 2017 at 1:28 PM, Tobias Soloschenko <
> > tobiassoloschenko@googlemail.com> wrote:
> >
> >> Hi,
> >>
> >> maybe we could add a callback method to add the name or a second
> >> parameter, because in case of a FileSystemResource this might me a usual
> >> scenario.
> >>
> >> WDYT?
> >>
> >> kind regards
> >>
> >> Tobias
> >>
> >>> Am 12.04.2017 um 08:25 schrieb Sven Meier <sv...@meiers.net>:
> >>>
> >>> Hi Maxim,
> >>>
> >>> FIleSystemResource does not support a file name by default, you have to
> >> add it yourself:
> >>>
> >>> protected ResourceResponse createResourceResponse(Path path) {
> >>>   ResourceResponse response = super.createResourceResponse(path);
> >>>   response.setFileName(path.getFileName());
> >>>   return response;
> >>> }
> >>>
> >>> Regards
> >>> Sven
> >>>
> >>>
> >>>> On 12.04.2017 07:45, Maxim Solodovnik wrote:
> >>>> Hello Tobias,
> >>>>
> >>>> I'm trying to use FileSystemResource in latest wicket AjaxDownload
> >>>> Unfortunately I see no easy way to set filename :(
> >>>>
> >>>> It seems not to be taken from the Path passed ...
> >>>> Could you please tell me how to do it?
> >>>>
> >>>
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >>> For additional commands, e-mail: users-help@wicket.apache.org
> >>>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >>
> >
> >
> > --
> > WBR
> > Maxim aka solomax
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
WBR
Maxim aka solomax

Re: Setting file name for FileSystemResource

Posted by Tobias Soloschenko <to...@googlemail.com>.
Hi,

I am very sorry that I am bussy at the moment. Are you able to create a PR for that. I review it as soon as possible.

kind regards

Tobias

> Am 12.04.2017 um 08:30 schrieb Maxim Solodovnik <so...@gmail.com>:
> 
> I would use file name from the Path by default
> And the ability to pass different name is also good idea
> 
> On Wed, Apr 12, 2017 at 1:28 PM, Tobias Soloschenko <
> tobiassoloschenko@googlemail.com> wrote:
> 
>> Hi,
>> 
>> maybe we could add a callback method to add the name or a second
>> parameter, because in case of a FileSystemResource this might me a usual
>> scenario.
>> 
>> WDYT?
>> 
>> kind regards
>> 
>> Tobias
>> 
>>> Am 12.04.2017 um 08:25 schrieb Sven Meier <sv...@meiers.net>:
>>> 
>>> Hi Maxim,
>>> 
>>> FIleSystemResource does not support a file name by default, you have to
>> add it yourself:
>>> 
>>> protected ResourceResponse createResourceResponse(Path path) {
>>>   ResourceResponse response = super.createResourceResponse(path);
>>>   response.setFileName(path.getFileName());
>>>   return response;
>>> }
>>> 
>>> Regards
>>> Sven
>>> 
>>> 
>>>> On 12.04.2017 07:45, Maxim Solodovnik wrote:
>>>> Hello Tobias,
>>>> 
>>>> I'm trying to use FileSystemResource in latest wicket AjaxDownload
>>>> Unfortunately I see no easy way to set filename :(
>>>> 
>>>> It seems not to be taken from the Path passed ...
>>>> Could you please tell me how to do it?
>>>> 
>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>> 
>> 
> 
> 
> -- 
> WBR
> Maxim aka solomax

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Setting file name for FileSystemResource

Posted by Maxim Solodovnik <so...@gmail.com>.
I would use file name from the Path by default
And the ability to pass different name is also good idea

On Wed, Apr 12, 2017 at 1:28 PM, Tobias Soloschenko <
tobiassoloschenko@googlemail.com> wrote:

> Hi,
>
> maybe we could add a callback method to add the name or a second
> parameter, because in case of a FileSystemResource this might me a usual
> scenario.
>
> WDYT?
>
> kind regards
>
> Tobias
>
> > Am 12.04.2017 um 08:25 schrieb Sven Meier <sv...@meiers.net>:
> >
> > Hi Maxim,
> >
> > FIleSystemResource does not support a file name by default, you have to
> add it yourself:
> >
> >  protected ResourceResponse createResourceResponse(Path path) {
> >    ResourceResponse response = super.createResourceResponse(path);
> >    response.setFileName(path.getFileName());
> >    return response;
> >  }
> >
> > Regards
> > Sven
> >
> >
> >> On 12.04.2017 07:45, Maxim Solodovnik wrote:
> >> Hello Tobias,
> >>
> >> I'm trying to use FileSystemResource in latest wicket AjaxDownload
> >> Unfortunately I see no easy way to set filename :(
> >>
> >> It seems not to be taken from the Path passed ...
> >> Could you please tell me how to do it?
> >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
WBR
Maxim aka solomax

Re: Setting file name for FileSystemResource

Posted by Tobias Soloschenko <to...@googlemail.com>.
Hi,

maybe we could add a callback method to add the name or a second parameter, because in case of a FileSystemResource this might me a usual scenario. 

WDYT?

kind regards

Tobias

> Am 12.04.2017 um 08:25 schrieb Sven Meier <sv...@meiers.net>:
> 
> Hi Maxim,
> 
> FIleSystemResource does not support a file name by default, you have to add it yourself:
> 
>  protected ResourceResponse createResourceResponse(Path path) {
>    ResourceResponse response = super.createResourceResponse(path);
>    response.setFileName(path.getFileName());
>    return response;
>  }
> 
> Regards
> Sven
> 
> 
>> On 12.04.2017 07:45, Maxim Solodovnik wrote:
>> Hello Tobias,
>> 
>> I'm trying to use FileSystemResource in latest wicket AjaxDownload
>> Unfortunately I see no easy way to set filename :(
>> 
>> It seems not to be taken from the Path passed ...
>> Could you please tell me how to do it?
>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Setting file name for FileSystemResource

Posted by Sven Meier <sv...@meiers.net>.
Hi Maxim,

FIleSystemResource does not support a file name by default, you have to 
add it yourself:

   protected ResourceResponse createResourceResponse(Path path) {
     ResourceResponse response = super.createResourceResponse(path);
     response.setFileName(path.getFileName());
     return response;
   }

Regards
Sven


On 12.04.2017 07:45, Maxim Solodovnik wrote:
> Hello Tobias,
>
> I'm trying to use FileSystemResource in latest wicket AjaxDownload
> Unfortunately I see no easy way to set filename :(
>
> It seems not to be taken from the Path passed ...
> Could you please tell me how to do it?
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org