You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by brazz <al...@man.eu> on 2012/06/13 13:56:02 UTC

FileUpload temp files never get removed also they get tracked

Hi,

I'm using the FileUpload Component. The component creates temporary files
"upload....tmp". 
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-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


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

Posted by Martin Grigorov <mg...@apache.org>.
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 <al...@man.eu> wrote:
> Hi,
>
> I'm using the FileUpload Component. The component creates temporary files
> "upload....tmp".
> 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-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>



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

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


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

Posted by brazz <al...@man.eu>.
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-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org