FileUpload temp files never get removed also they get tracked

2012-06-13 Thread brazz
Hi,

I'm using the FileUpload Component. The component creates temporary files
uploadtmp. 
I set some breakpoints to see what happens.

In DiskFileItem i can see that the File is added to the FileCleaner:

FileCleaner.track(tempFile, this);

but the File never gets removed from Disk.
I also added the apache commons FileCleanerCleanup -Listener to my web.xml.

listener-class
org.apache.commons.fileupload.servlet.FileCleanerCleanup
/listener-class

Is this a bug or am i missing something?
If it's a bug, is there a workaround?

Thanks for any suggestions.


I'm using wicket 1.4.17


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/FileUpload-temp-files-never-get-removed-also-they-get-tracked-tp4649926.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: FileUpload temp files never get removed also they get tracked

2012-06-13 Thread Martin Grigorov
Hi,

I don't remember how 1.4.x works exactly in this code but for 1.5 we
improved it by creating an interface
org.apache.wicket.util.file.IFileCleaner which is configured in
org.apache.wicket.settings.IResourceSettings#setFileCleaner().

By default it uses Apache-Commons FileCleaningTracker which uses a
Thread to do its work. But now Google AppEngine users can provide
their own impl if needed too.

org.apache.wicket.protocol.http.WebApplication#internalDestroy() calls
IFileCleaner#destroy() so it should clean when the app is going down.

Put a breakpoint in
org.apache.wicket.util.file.FileCleaningTracker.Reaper#run() and see
what happens.

On Wed, Jun 13, 2012 at 2:56 PM, brazz alexander.li...@man.eu wrote:
 Hi,

 I'm using the FileUpload Component. The component creates temporary files
 uploadtmp.
 I set some breakpoints to see what happens.

 In DiskFileItem i can see that the File is added to the FileCleaner:

 FileCleaner.track(tempFile, this);

 but the File never gets removed from Disk.
 I also added the apache commons FileCleanerCleanup -Listener to my web.xml.

 listener-class
                org.apache.commons.fileupload.servlet.FileCleanerCleanup
 /listener-class

 Is this a bug or am i missing something?
 If it's a bug, is there a workaround?

 Thanks for any suggestions.


 I'm using wicket 1.4.17


 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/FileUpload-temp-files-never-get-removed-also-they-get-tracked-tp4649926.html
 Sent from the Users forum mailing list archive at Nabble.com.

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: FileUpload temp files never get removed also they get tracked

2012-06-13 Thread brazz
Thanks for your reply Martin!

After i declared the commons FileCleaner interface in my web.xml the file
was removed after my session timed out. Obviously i was just to impatient.
It also went through the breakpoint in the reaper thread. 
I thin this functionality is enough for my needs.

Thank you!



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/FileUpload-temp-files-never-get-removed-also-they-get-tracked-tp4649926p4649930.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org