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]

Reply via email to