[ 
http://www.stripesframework.org/jira/browse/STS-583?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Chris Herron updated STS-583:
-----------------------------

    Attachment: StreamingResolutionLengthAndLastMod2.patch

Added updated patch (#2). I have found that the content-disposition header is 
not effective in reporting filename, size, last-modified values for direct 
downloads of files. The means that for files downloaded via StreamingResolution:

* Browsers don't show accurate progress indicators
* File caching (e.g. Java Web Start) behavior is erratic

So I have updated the patch to include:

* An "attachment" flag that toggles between the original content-disposition 
header behavior (default) and setting response headers for a "direct" download.
* Added a protected non-final method applyHeaders, which separates the 
header-setting code from the streaming execution call. This allows developers 
to override the header behavior to aid extensibility. Tim may have had a reason 
for making the execute method final, but its not apparent to me that this 
separation has any downsides.

To use the new header behavior, you need to set the attachment flag to false:

return new StreamingResolution(foo).setAttachment(false)

> Add "length" property to StreamingResolution
> --------------------------------------------
>
>                 Key: STS-583
>                 URL: http://www.stripesframework.org/jira/browse/STS-583
>             Project: Stripes
>          Issue Type: Improvement
>    Affects Versions: Release 1.5.1
>            Reporter: Chris Herron
>            Priority: Minor
>             Fix For: Release 1.5.2
>
>         Attachments: StreamingResolutionLengthAndLastMod.patch, 
> StreamingResolutionLengthAndLastMod2.patch
>
>
> StreamingResolution already has a filename property which can be helpful for 
> browser "Save As" dialogs.  I suggest adding a "length" property - to match 
> java.io.File#length(). This would be used as the Content-Disposition "size" 
> param.
> In addition to filename and size, the Content-Disposition RFC 
> (http://www.ietf.org/rfc/rfc2183.txt) names a few other parameters that might 
> be useful: creation-date, modification-date and read-date, however only 
> lastModified is available on java.io.File.
> Adding the size property might result in more informative download progress 
> bars. I have not tested this yet.
> I tested adding the last-modified parameter, in the hope that the resulting 
> downloaded file would inherit that timestamp, however for the only browser I 
> tested (Safari) this was not honored. It may be honored by other browsers.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://www.stripesframework.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to