Issue Details (XML | Word | Printable)

Key: FILEUPLOAD-22
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Unassigned
Reporter: Lars Marius Garshol
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Commons FileUpload

FileUpload default constructor does not create a factory

Created: 15/Oct/03 02:41 AM   Updated: 09/Mar/07 08:31 PM
Return to search
Component/s: None
Affects Version/s: 1.0 Final
Fix Version/s: None

Time Tracking:
Not Specified

Environment:
Operating System: All
Platform: All

Bugzilla Id: 23822


 Description  « Hide
The default constructor of the FileUpload class (no parameters) is said by the
documentation to use "the default factory", but the code doesn't actually create
any factory at all (fileItemFactory attribute is null), so any attempt to use
the class causes a NullPointerException. Either the documentation or the code
should be fixed. Personally, I think the code should be fixed. Why make the
class harder to use than necessary?

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Martin Cooper added a comment - 01/Feb/04 12:55 PM
Fixed in the 20040201 nightly build.

I fixed the Javadoc rather than the code because there is no default factory.
The purpose of the FileUpload class is to enable customised implementations, so
it cannot know in advance of any particular factory. (The DiskFileUpload class
provides a standard implementation that saves files to disk, or keeps them in
memory if they are small enough.)