Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
ServletFileUpload implements a custom iterator, which doesn't implement java.util.Iterator. We should consider implementing Iterable<FileUploadStream> on ServletFileUpload so that is can be used in enhanced for loops. Further more, the iterator could then be used by other APIs which consume Iterator instances. The iterator returned by the Iterable.iterator() method could be a thin wrapper around FileItemIterator, which throughs UnsupportedOperationException when remove() is called.