tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Pat <cpa...@yahoo.com>
Subject Re: tomcat temp directory
Date Mon, 04 Jun 2007 10:13:35 GMT
Hi Martin, David
Thanks.
Where/syntax to set the tmpdir?
Below is the syntax I use and when run from local host it puts the files in the "root" tomcat
directory, at the same level as the all the subdirectories.  Even outside the webapp directory.
 However it is accessible.

When I switch to accessing from a domain with modjk, TC cant find the file.  The very same
code that calls a servlet to populate a html img tag is blank, but the rest of the page renders
correctly.  

I also found something claiming that TC configures its own tmp directory per webapp.  Is that
from the proper setting of CATALINA_TMPDIR in the server.xml?  with what syntax?  tia.

String tempdir = System.getProperty("java.io.tmpdir");
      if (! (tempdir.endsWith("/") || tempdir.endsWith("\\"))) {
        tempdir = tempdir + System.getProperty("file.separator");
      }
      File tempFile = null;
      try {
        tempFile = File.createTempFile("myFile", "." + outputType);
      }
      catch (IOException ex2) {
      }

Martin Gainty <mgainty@hotmail.com> wrote: Hi Chris-
did you set CATALINA_TMPDIR to your TOMCAT temp folder?
M--
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

----- Original Message ----- 
From: "Chris Pat" 
To: "Tomcat" 
Sent: Sunday, June 03, 2007 10:02 PM
Subject: tomcat temp directory


> Hello
> How do I configure and access a temporary directory in Tomcat5x?  Oddly I 
> am presently writing files I want to use immediately into java.io.tempdir 
> and it works if I access the webapp from localhost.  However fails when 
> accessed from a domain.
>
> Within the Action/servlet how to I write/read the context specific temp 
> directory?  Is there a way to release the file lock that Tomcat will have 
> on that file?  I close all streams, but in previous primitive way it held 
> the lock and I had to stop/restart TC.  Any help along understanding this 
> would be greatly appreciated.
> 


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org



Mime
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message