jvanzyl     01/10/28 10:47:28

  Modified:    src/java/org/apache/torque Torque.java
               src/test Torque.properties
  Log:
  - in stand-alone mode make sure that the logs directory is created so
    that log4j can do its thing.
  
    change the applicationRoot so that the runtime-tests will work
    from the dist directory.
  
  Revision  Changes    Path
  1.22      +13 -2     jakarta-turbine-torque/src/java/org/apache/torque/Torque.java
  
  Index: Torque.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-torque/src/java/org/apache/torque/Torque.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- Torque.java       2001/10/28 18:39:11     1.21
  +++ Torque.java       2001/10/28 18:47:28     1.22
  @@ -54,6 +54,7 @@
    * <http://www.apache.org/>.
    */
   
  +import java.io.File;
   import java.io.FileInputStream;
   import java.io.IOException;
   import java.util.HashMap;
  @@ -82,7 +83,7 @@
    * @author <a href="mailto:[EMAIL PROTECTED]";>Magn�s ��r Torfason</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Jason van Zyl</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Rafal Krzewski</a>
  - * @version $Id: Torque.java,v 1.21 2001/10/28 18:39:11 jvanzyl Exp $
  + * @version $Id: Torque.java,v 1.22 2001/10/28 18:47:28 jvanzyl Exp $
    */
   public class Torque
   {
  @@ -192,7 +193,17 @@
               // Get the applicationRoot for use in the log4j
               // properties.
               String applicationRoot = c.getString("applicationRoot", ".");
  -        
  +            
  +            File logsDir = new File(applicationRoot, "logs");
  +            
  +            if (logsDir.exists() == false)
  +            {
  +                if (logsDir.mkdirs() == false)
  +                {
  +                    System.err.println("Cannot create logs directory!");
  +                }                    
  +            }
  +            
               Properties p = new Properties();
               p.load(new FileInputStream(configFile));
               // Set the applicationRoot in the log4j properties so that
  
  
  
  1.3       +3 -1      jakarta-turbine-torque/src/test/Torque.properties
  
  Index: Torque.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-torque/src/test/Torque.properties,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Torque.properties 2001/10/28 03:16:34     1.2
  +++ Torque.properties 2001/10/28 18:47:28     1.3
  @@ -1,5 +1,5 @@
   # -------------------------------------------------------------------
  -# $Id: Torque.properties,v 1.2 2001/10/28 03:16:34 jvanzyl Exp $
  +# $Id: Torque.properties,v 1.3 2001/10/28 18:47:28 jvanzyl Exp $
   #
   # This is the configuration file for Torque.
   #
  @@ -7,6 +7,8 @@
   # escape the comma (i.e. '\,')
   #
   # -------------------------------------------------------------------
  +
  +torque.applicationRoot = bin/torque/torque
   
   # -------------------------------------------------------------------
   # 
  
  
  

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

Reply via email to