Hi,
I'm using FileUploadField.
Once the file is uploaded, I then fork a background thread to blat the
file into another system using an InputStream -> OutputStream copy.
Problem is, I get an InputStream using FileUpload#getInputStream(),
which adds that stream to a list.
When the FileUploadField's onDetach() method is called, all the
InputStreams in this list are forcibly closed.
This is no good at all, as I'm mid-copy in my background thread at this
point.
These files can be huge (100's of Mb). I therefore don't want to either:
- Wait until the copy is done before rendering a response page to the
user (I have this background thread for a reason).
- Copy the perfectly good temporary file I already have on disk to
yet another one with FileUpload#writeTo(File) before I then fork this
thread. Besides, copying things will take a few seconds, which isn't
very good either.
Any ideas?
Do we really need to go around and aggressively clean up these
InputStreams? Can't we do that in a finalize() method somewhere?
Regards,
Al
--
Alastair Maw
Wicket-biased blog at http://herebebeasties.com