[ 
https://issues.apache.org/jira/browse/FILEUPLOAD-130?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael Macaluso updated FILEUPLOAD-130:
----------------------------------------

    Attachment: FileUpload-130_2.patch

Here is another version that reduces the changes. It adds an interface called 
FileItemHeadersSupport and a class Headers.  The FileItemHeadersSupport 
interface adds an ability to get and set the headers on the instance.  The 
class Headers is a utility class that helps in the nasty casting that is 
required when using the FileItemHeadersSupport interface.  The only two classes 
modified are DiskFileItem and FileUploadBase.  The implementations of FileItem 
and FileItemStream within this package (i.e., DiskFileItem and 
FileItemStreamImpl) implement this interface.  Since you really can not 
implement your own FileItemStream, that side is covered.  If one implements a 
custom FileItem implementation and does not inherit from DiskFileItem, then all 
they must do is implement the FileItemHeadersSupport interface and the headers 
will be available.

Docs will be done after we agree on the final approach.

> Add ability to get any header from the FileItem and FileItemStream interfaces
> -----------------------------------------------------------------------------
>
>                 Key: FILEUPLOAD-130
>                 URL: https://issues.apache.org/jira/browse/FILEUPLOAD-130
>             Project: Commons FileUpload
>          Issue Type: Improvement
>    Affects Versions: 1.2
>            Reporter: Michael Macaluso
>            Priority: Minor
>         Attachments: FileUpload-130_1.patch, FileUpload-130_2.patch
>
>
> The FileItem and FileItemStream interfaces should have a way to return back 
> any header that was encountered during the header parsing for an "Item".  
> Currently, from the FileItemStatus you can only get information from the 2 
> pre-defined headers "Content-Type" and "Content-Disposition" (Sort-of because 
> the header can not be accessed raw).  Other than the interface changes 
> (including the change to pass them along in the FileItemFactory interface), 
> it appears that all changes can be made within the FileUploadBase.java file.  
> FileUploadBase.java:859 (as of 1.2) has the headers, but the call to create 
> the FileItemStreamImpl on lines 877 and 887 do not include the headers map.  
> Further, the parseRequest method uses the FileItemStream interface to build 
> the FileItem, so you should always have the headers in question.
> The reason for this request is that we have an application that is sending 
> per-part headers (not precluded by the specs as far as we know of) to provide 
> more information than name and content-type and using the FileUpload project 
> means that we can no longer find out those header values.
> [Also, not completely sure, but I believe FileUploadBase.createItem(Map, 
> boolean) on line 480 is not referenced anymore in this project.]

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to