Howdy,
The only place the servlet specification allows you to write (and
obviously read) is the directory specified as the servlet context
attribute named javax.servlet.context.tempdir.

The JDK also has java.io.tmpdir which you may or may not be able to use.

Other than that, if you need to write to an arbitrary directory in a
spec-compliant way you need to specify the full path to the directory as
a context or init parameter, and you need to have the application
deployer create/modify that directory as necessary.

Yoav Shapira
Millennium ChemInformatics


>-----Original Message-----
>From: Daniel [mailto:[EMAIL PROTECTED]
>Sent: Friday, January 16, 2004 1:30 PM
>To: Tomcat Users List
>Subject: proper way to access local dir?
>
>
>Hi,
>
>I'm trying to access a "file respository" (for read and write of files)
>from my servlet.  I was wondering what's the best way to do this in a
>container/platform-independent manner?
>
>Is it possible without putting an "init" param in the web.xml that
>specifies my repository's directory or hard coding it into my servlet?
>
>I noticed the servlet 2.3 api has ServletContext.getResource(path) but
>it doesn't return a path to a local file directory that I'm interested
>in. :(
>
>Regards,
>Daniel
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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

Reply via email to