tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <ma...@apache.org>
Subject Re: Shouldn't Servlet 3.0 file upload delete temporary files after request completes
Date Wed, 27 Jun 2012 17:26:21 GMT
On 27/06/2012 17:19, Konstantin Kolinko wrote:
> Hi!
> 
> I was experimenting with Servlet 3.0 file upload. What seems odd is
> that after request is processed the uploaded files are still present
> in the work directory of the web application.
> 
> The only way to reliably delete those files is what HTMLManagerServlet
> does, like
> 
>         Iterator<Part> iter = parts.iterator();
>         while (iter.hasNext()) {
>             Part part = iter.next();
>             part.delete();
>         }
> 
> but when I use simpler code like  request.getPart("file"); to directly
> access the field that I need  it feels odd that I need to explicitly
> iterate over parts to perform the cleanup.

I don't see the harm in automatically cleaning up a the end of the request.

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message