geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmcma...@apache.org
Subject svn commit: r543618 - /geronimo/sandbox/j2g/configurator/src/org/apache/geronimo/j2g/Configurator.java
Date Fri, 01 Jun 2007 21:14:50 GMT
Author: pmcmahan
Date: Fri Jun  1 14:14:49 2007
New Revision: 543618

URL: http://svn.apache.org/viewvc?view=rev&rev=543618
Log:
GERONIMO-3162 remove hard coded pathnames from J2G.  patch provided by Jason Warner

Modified:
    geronimo/sandbox/j2g/configurator/src/org/apache/geronimo/j2g/Configurator.java

Modified: geronimo/sandbox/j2g/configurator/src/org/apache/geronimo/j2g/Configurator.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/configurator/src/org/apache/geronimo/j2g/Configurator.java?view=diff&rev=543618&r1=543617&r2=543618
==============================================================================
--- geronimo/sandbox/j2g/configurator/src/org/apache/geronimo/j2g/Configurator.java (original)
+++ geronimo/sandbox/j2g/configurator/src/org/apache/geronimo/j2g/Configurator.java Fri Jun
 1 14:14:49 2007
@@ -44,13 +44,13 @@
 	/**
 	 * J2g plug-ins path.
 	 */
-	public static final String LOCAL_ECLIPSE_PLUGINS = "../eclipse/plugins";
-
+	public static String LOCAL_ECLIPSE_PLUGINS = "plugins";
+	
 	/**
 	 * J2g configuration path.
 	 */
-	public static final String LOCAL_ECLIPSE_CONFIG = "../eclipse/configuration";
 
+	public static String LOCAL_ECLIPSE_CONFIG = "configuration";
 	/**
 	 * Pattern for external bundles.
 	 */
@@ -73,18 +73,21 @@
 	public static void main(String[] args) {
 		if (args.length != 0) {
 			try {
-				File confDir = new File(LOCAL_ECLIPSE_CONFIG);
-				if(!confDir.exists())
-				{
-					confDir.mkdir();
-				}
-				String filename = LOCAL_ECLIPSE_CONFIG + File.separator + CONFIG_FILE;
-				File file = new File(filename);
-				file.createNewFile();
+				
 				Properties config = new Properties();
 				String home = args[0];
 				if (home != null) {
 					String eclipseDir = home.replace('\\', '/');
+					LOCAL_ECLIPSE_CONFIG = eclipseDir + File.separator + LOCAL_ECLIPSE_CONFIG;
+					LOCAL_ECLIPSE_PLUGINS = eclipseDir + File.separator + LOCAL_ECLIPSE_PLUGINS;
+					File confDir = new File(LOCAL_ECLIPSE_CONFIG);
+					if(!confDir.exists())
+					{
+						confDir.mkdir();
+					}
+					String filename = LOCAL_ECLIPSE_CONFIG + File.separator + CONFIG_FILE;
+					File file = new File(filename);
+					file.createNewFile();
 					config.setProperty(INSTALL_AREA, eclipseDir);
 					String bundles = DEFAULT_BUNDLES;
 					File pluginsDir = new File(LOCAL_ECLIPSE_PLUGINS);
@@ -101,14 +104,15 @@
 					System.out.println("Configuration complete.");
 				}
 				else {
-					System.out.println("System environment variable ECLIPSE_HOME does not set.");
+					System.out.println("System environment variable ECLIPSE_HOME is not set.");
 				}
 			} catch (IOException e) {
-				System.out.println("Cannot create config.ini file. Please, make sure that it is not open
and try once again.");
+				System.out.println("Cannot create config.ini file. Please, make sure that it is not open
and try once again. ");
+				e.printStackTrace();
 			}
 		}
 		else {
-			System.out.println("System environment variable ECLIPSE_HOME does not set.");
+			System.out.println("System environment variable ECLIPSE_HOME is not set.");
 		}
 
 	}



Mime
View raw message