You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Paul Speed <ps...@progeeks.com> on 2004/10/15 18:19:33 UTC
[Off-Topic] Re: java.io.tempdir Problems
It sounds like maybe there is some confusion between environment
variables and system properties.
java.io.tempdir is a system property which presumably means it can be
set on the Java command line using -Djava.io.tempdir="foo"
This is different then anything getenv() would return since those would
be environment variables. Some of which are reflected as differently
named system properties. For example, I think java.io.tempdir defaults
to the TEMP environment variable under Windows and perhaps TMP under
Unix or something like that. I'd have to drill into javadocs to be sure.
-Paul
Michael McGrady wrote:
> I don't know if this is helpful or not, Martin, but if you attempt
> System.getenv("java.io.tempdir") [which is deprecated], you get as part
> of the error message
> "getenv no longer supported, use properties and -D instead:
> java.io.tempdir". Is that helpful? Does the -D there mean as in
> -Djava.io.tempdir?
>
> Michael
>
> Martin Gainty wrote:
>
>> Good Afternoon Michael
>> Perusing the Manual for Jspc at
>> http://64.233.167.104/search?q=cache:pfbfEPvvvHUJ:www.gefionsoftware.com/Lit
>>
>> eWebServer/lws-jsp/ReferenceManual.pdf+TOMCAT+java.io.tempDir+-Djava.io.temp
>>
>> Dir&hl=en
>> formal syntax for the JSPC command
>> jspc [options] -webapp web-app-root-dir
>> Where option
>> -d output-dir specifies
>> The -d output-dir specification is the directory specified by the
>> java.io.tempdir system property
>> I see that there are 2 ways to specify java.io.tempdir System Property
>> Anyone else
>> The directory specified by the java.io.tempdirsystem property The
>> directory
>> specified by the java.io.tempdirsystem property The directory
>> specified by
>> the java.io.tempdirsystem property The directory specified by the
>> java.io.tempdir???
>> Martin
>> ----- Original Message -----
>> From: "Michael McGrady" <mi...@michaelmcgrady.com>
>> To: "Tomcat Developers List" <to...@jakarta.apache.org>
>> Sent: Thursday, October 14, 2004 11:46 AM
>> Subject: Re: java.io.tempdir Problems
>>
>>
>>
>>
>>> Martin,
>>>
>>> Perhaps I should add, Martin, that if I set the environment variables
>>> for java.io.tempdir and -Djava.io.tempdir in the application but not in
>>> Tomcat startup, I don't have the problem. I am a bit confused about
>>> whether to use java.io.tempdir or -Djava.io.tempdir. Can you explain a
>>> bit about that?
>>>
>>> Michael McGrady
>>>
>>> Martin Gainty wrote:
>>>
>>>
>>>
>>>> Michael
>>>> createTempFile employs 3 steps algorithm to locate/create "tempDir"
>>>> 1) Attempt to retrieve the value of "javax.servlet.context.tempdir"
>>>> from
>>>>
>>
>> the
>>
>>
>>>> ServletContext
>>>> 2) If that's not found, attempt to retrieve the value of the
>>>>
>>
>> init-parameter
>>
>>
>>>> "tempDir"
>>>> 3) If that's not found, default to the system-wide temp directory
>>>>
>>
>> specified
>>
>>
>>>> by the system property "java.io.tempdir"
>>>> A)what is the value of "javax.servlet.context.tempdir" from the
>>>> ServletContext?
>>>> B)what is the value of the init-parameter "tempDir"?
>>>> Martin-
>>>> ----- Original Message -----
>>>> From: "Michael McGrady" <mi...@michaelmcgrady.com>
>>>> To: "Tomcat Developers List" <to...@jakarta.apache.org>
>>>> Sent: Thursday, October 14, 2004 3:16 AM
>>>> Subject: java.io.tempdir Problems
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>> I hope this is Tomcat related. If not, please accept my apologies,
>>>>> and
>>>>> give me direction. I have removed from my Tomcat 5 (Struts 1.2
>>>>> using a
>>>>> custom taglib) service the java.io.tempdir setting because when I use
>>>>> the following code:
>>>>>
>>>>> File file = new File(Classpath.WEB_INF +
>>>>> "resource" + File.separator +
>>>>> "content_type" + File.separator +
>>>>> "ttf" + File.separator +
>>>>> physicalName);
>>>>> FileInputStream fontStream = new FileInputStream(file);
>>>>> Font font = Font.createFont(Font.TRUETYPE_FONT,fontStream);
>>>>> font = font.deriveFont(attributes);
>>>>> fontStream.close();
>>>>>
>>>>> I get temp files of around 50 - 150 kilobytes each written to the temp
>>>>> directory. I requested assistance on Tomcat User without an answer.
>>>>>
>>>>> Anyway, I assume that there may be a concurrency issue of
>>>>> somekind. Is
>>>>> that right? Anyone with any assistance out there?
>>>>>
>>>>> Michael McGrady
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
>>>>> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
>>>> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
>>
>>
>>
>>
>>
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org