Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: Release 1.5.1
-
Fix Version/s: Release 1.5.2
-
Component/s: None
-
Labels:None
Description
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.
Uploading patch with example code for adding the size and last-modified Content-Disposition params.
The exposed properties are named and typed to match java.io.File.
Should probably ditch the lastModified property unless you find a good reason to support it. Left it in just in case.
Implementation alternative: aporter suggested keeping the external properties, but having an internal map. This is not worthwhile if you only go with adding the size property.