dblevins    2005/07/09 01:53:21

  Modified:    modules/core/src/java/org/openejb/alt/config
                        ConfigUtils.java ConfigurationFactory.java
  Log:

  Yanking getBase(props) and getHome(props) calls and replacing with a one-time 
call to:
    FileUtils.init(props)
  Which will reset the home and base instances.
  
  Revision  Changes    Path
  1.10      +6 -6      
openejb1/modules/core/src/java/org/openejb/alt/config/ConfigUtils.java
  
  Index: ConfigUtils.java
  ===================================================================
  RCS file: 
/home/projects/openejb/scm/openejb1/modules/core/src/java/org/openejb/alt/config/ConfigUtils.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- ConfigUtils.java  9 Jul 2005 05:14:46 -0000       1.9
  +++ ConfigUtils.java  9 Jul 2005 05:53:21 -0000       1.10
  @@ -322,7 +322,7 @@
                * [2] Try finding the file relative to the openejb.base 
directory
                */
               try {
  -                file = FileUtils.getBase(props).getFile(path);
  +                file = FileUtils.getBase().getFile(path);
                   if (file != null && file.exists() && file.isFile()) {
                       return file.getAbsolutePath();
                   }
  @@ -334,7 +334,7 @@
                * [3] Try finding the file relative to the openejb.home 
directory
                */
               try {
  -                file = FileUtils.getHome(props).getFile(path);
  +                file = FileUtils.getHome().getFile(path);
                   if (file != null && file.exists() && file.isFile()) {
                       return file.getAbsolutePath();
                   }
  @@ -352,7 +352,7 @@
                * openejb.base directory
                */
               try {
  -                file = FileUtils.getBase(props).getFile("conf/openejb.conf");
  +                file = FileUtils.getBase().getFile("conf/openejb.conf");
                   if (file != null && file.exists() && file.isFile()) {
                       return file.getAbsolutePath();
                   }
  @@ -364,7 +364,7 @@
                * openejb.home directory
                */
               try {
  -                file = FileUtils.getHome(props).getFile("conf/openejb.conf");
  +                file = FileUtils.getHome().getFile("conf/openejb.conf");
                   if (file != null && file.exists() && file.isFile()) {
                       return file.getAbsolutePath();
                   }
  @@ -378,7 +378,7 @@
                *     the openejb-x.x.x.jar
                */
               //Gets the conf directory, creating it if needed.
  -            File confDir = FileUtils.getBase(props).getDirectory("conf", 
true);
  +            File confDir = FileUtils.getBase().getDirectory("conf", true);
               
               //TODO:1: We cannot find the user's conf file and
               // are taking the liberty of creating one for them.
  
  
  
  1.11      +6 -6      
openejb1/modules/core/src/java/org/openejb/alt/config/ConfigurationFactory.java
  
  Index: ConfigurationFactory.java
  ===================================================================
  RCS file: 
/home/projects/openejb/scm/openejb1/modules/core/src/java/org/openejb/alt/config/ConfigurationFactory.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- ConfigurationFactory.java 9 Jul 2005 05:14:47 -0000       1.10
  +++ ConfigurationFactory.java 9 Jul 2005 05:53:21 -0000       1.11
  @@ -1136,10 +1136,10 @@
                   if (d.getDir() == null && d.getJar() != null) {
                       File jar = null;
                       try {
  -                        jar = 
FileUtils.getBase(this.props).getFile(d.getJar(), false);
  +                        jar = FileUtils.getBase().getFile(d.getJar(), false);
                       } catch (Exception ignored) {
                           try {
  -                            jar = 
FileUtils.getHome(this.props).getFile(d.getJar(), false);
  +                            jar = FileUtils.getHome().getFile(d.getJar(), 
false);
                           } catch (Exception ignoredAgain) {
                           }
                       }
  @@ -1155,12 +1155,12 @@
   
                   File dir = null;
                   try {
  -                    dir = FileUtils.getBase(this.props).getFile(d.getDir(), 
false);
  +                    dir = FileUtils.getBase().getFile(d.getDir(), false);
                   } catch (Exception ignored) {
                   }
                   if (dir == null || !dir.exists()) {
                       try {
  -                        dir = 
FileUtils.getHome(this.props).getFile(d.getDir(), false);
  +                        dir = FileUtils.getHome().getFile(d.getDir(), false);
                       } catch (Exception ignoredAgain) {
                       }
                   }
  @@ -1198,7 +1198,7 @@
   
                       dir = null;
                       try {
  -                        dir = 
FileUtils.getHome(this.props).getFile(d.getDir(), false);
  +                        dir = FileUtils.getHome().getFile(d.getDir(), false);
                       } catch (Exception ignoredAgain) {
                       }
   
  
  
  

Reply via email to