Yeah. It still works if it's null, since it behaves like it did before
(resolved against user.dir), however it's easier to understand what is
happening if the null check would happen.
Rob
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Jon Stevens
Sent: Monday, September 04, 2000 8:36 PM
To: Turbine
Subject: Re: Resolve turbine log directory against tomcat.home for
relative paths?
on 9/4/2000 8:32 PM, "Rob Clevenger" <[EMAIL PROTECTED]> wrote:
> Would this behavior be desired? I tend to think it would, since be
default
> relative paths are resolved against user.dir, which may or may not be the
> proper location.
>
> If so, here's a diff of the changes required for it. The webmacro code
for
> where it finds it's logfile won't work with relative paths's with this
> change, but velocity isn't too far away.
>
>
> Rob
>
>
> --- Log.java Mon Sep 4 20:14:51 2000
> ***************
> *** 141,146 ****
> --- 141,153 ----
>
> if (logFileString != null)
> {
> + File logFileFile = new File(logFileString);
> + if (!logFileFile.isAbsolute())
> + {
> + String tomcatHomeDir =
> System.getProperty("tomcat.home");
> + logFileString = new File(tomcatHomeDir,
> logFileString)
> + .getAbsolutePath();
> + }
> logfile = new FileWriter( logFileString, true );
> }
>
This is close, but it is dependent on tomcat being installed. The other
issue is that you don't check for a null value for tomcatHomeDir. :-)
-jon
--
http://scarab.tigris.org/ | http://noodle.tigris.org/
http://java.apache.org/ | http://java.apache.org/turbine/
http://www.working-dogs.com/ | http://jakarta.apache.org/velocity/
http://www.collab.net/ | http://www.sourcexchange.com/
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]