avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/launcher Main.java
Date Fri, 12 Jul 2002 22:03:31 GMT
donaldp     2002/07/12 15:03:31

  Modified:    src/java/org/apache/avalon/phoenix/launcher Main.java
  Log:
  Refactored out a method to findPhoenixHome() directory
  
  Revision  Changes    Path
  1.17      +19 -4     jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/launcher/Main.java
  
  Index: Main.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/launcher/Main.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- Main.java	4 Jun 2002 22:03:37 -0000	1.16
  +++ Main.java	12 Jul 2002 22:03:31 -0000	1.17
  @@ -139,6 +139,24 @@
       private static final File findEngineJar()
           throws Exception
       {
  +        final String phoenixHome = findPhoenixHome();
  +
  +        final String filename =
  +            phoenixHome + File.separator + "bin" + File.separator + MAIN_JAR;
  +        return ( new File( filename ) ).getCanonicalFile();
  +    }
  +
  +    /**
  +     * Utility method to find the home directory
  +     * of Phoenix and make sure system property is
  +     * set to it.
  +     *
  +     * @return the location of phoenix directory
  +     * @throws Exception if unable to locate directory
  +     */
  +    private static String findPhoenixHome()
  +        throws Exception
  +    {
           String phoenixHome = System.getProperty( "phoenix.home", null );
           if( null == phoenixHome )
           {
  @@ -148,10 +166,7 @@
   
           phoenixHome = ( new File( phoenixHome ) ).getCanonicalFile().toString();
           System.setProperty( "phoenix.home", phoenixHome );
  -
  -        final String filename =
  -            phoenixHome + File.separator + "bin" + File.separator + MAIN_JAR;
  -        return ( new File( filename ) ).getCanonicalFile();
  +        return phoenixHome;
       }
   
       /**
  
  
  

--
To unsubscribe, e-mail:   <mailto:avalon-cvs-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-cvs-help@jakarta.apache.org>


Mime
View raw message