How about the createTempFile method? It gives you a unique name in the correct 
directory (System defined temp directory, thus configurable by the administrator) and 
creates/locks the file so it can be used in multiuser environments.

http://java.sun.com/j2se/1.4.2/docs/api/java/io/File.html#createTempFile(java.lang.String,%20java.lang.String)

Hiran

-----------------------------------------
Hiran Chaudhuri
SAG Systemhaus GmbH
Elsenheimer Straße 11
80867 München
Phone +49-89-54 74 21 34
Fax   +49-89-54 74 21 99


 

> -----Original Message-----
> From: Shinobu Kawai [mailto:[EMAIL PROTECTED] 
> Sent: Montag, 18. Oktober 2004 14:46
> To: Struts Users Mailing List
> Subject: Re: Where Is a Proper Place To Store TEMPORARY Files?
> 
> Hi Caroline,
> 
> > Now, I have this situation: While the web application is running, I 
> > need a place to store an uploaded file temporarily and then 
> write this 
> > file out.
> > 
> > Where is the proper place to create a directory to store a 
> temporary 
> > file?
> > 
> > Is any place in the application OKay?
> I usually use System.getProperty("java.io.tmpdir").
>     
> http://localhost/java/jdk1.5.0/docs/api/java/lang/System.html#
> getProperties()
> 
> Best regards,
> -- Shinobu Kawai
> 
> --
> Shinobu Kawai <[EMAIL PROTECTED]>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to