Revision 8120 trunk/frameworks/_fwAndami/src/com/iver/andami/Launcher.java
Launcher.java | ||
---|---|---|
153 | 153 |
|
154 | 154 |
private static ArrayList pluginsOrdered = new ArrayList(); |
155 | 155 |
private static ArrayList extensions=new ArrayList(); |
156 |
private static String appHomeDir = null; |
|
156 | 157 |
/** |
157 | 158 |
* DOCUMENT ME! |
158 | 159 |
* |
... | ... | |
182 | 183 |
appName = args[0]; |
183 | 184 |
|
184 | 185 |
//Se crea el directorio de configuraci?n de la aplicaci?n |
185 |
File parent = new File(System.getProperty("user.home") + |
|
186 |
File.separator + args[0] + File.separator); |
|
186 |
appHomeDir = System.getProperty(args[0]+".home"); |
|
187 |
if (appHomeDir == null) |
|
188 |
appHomeDir = System.getProperty("user.home"); |
|
189 |
System.err.println("LWS: "+args[0]+".home"+"="+appHomeDir); |
|
190 |
appHomeDir += File.separator + args[0] + File.separator; |
|
191 |
File parent = new File( appHomeDir ); |
|
187 | 192 |
parent.mkdirs(); |
188 | 193 |
|
189 |
andamiConfigPath = System.getProperty("user.home") + File.separator + |
|
190 |
appName + File.separator + "andami-config.xml"; |
|
191 |
pluginsPersistencePath = System.getProperty("user.home") + |
|
192 |
File.separator + appName + File.separator + |
|
194 |
andamiConfigPath = appHomeDir + "andami-config.xml"; |
|
195 |
pluginsPersistencePath = appHomeDir + |
|
193 | 196 |
"plugins-persistence.xml"; |
194 | 197 |
|
195 | 198 |
// Configurar el log4j |
... | ... | |
198 | 201 |
|
199 | 202 |
PatternLayout l = new PatternLayout("%p %t %C - %m%n"); |
200 | 203 |
RollingFileAppender fa = new RollingFileAppender(l, |
201 |
System.getProperty("user.home") + File.separator + args[0] + |
|
202 |
File.separator + args[0] + ".log", false); |
|
204 |
appHomeDir + args[0] + ".log", false); |
|
203 | 205 |
fa.setMaxFileSize("512KB"); |
204 | 206 |
fa.setMaxBackupIndex(3); |
205 | 207 |
Logger.getRootLogger().addAppender(fa); |
... | ... | |
1215 | 1217 |
|
1216 | 1218 |
if (System.getProperty("javawebstart.version") != null) // Es java web start) |
1217 | 1219 |
{ |
1218 |
andamiConfig.setPluginsDirectory(new File(System.getProperty( |
|
1219 |
"user.home") + File.separator + appName + |
|
1220 |
File.separator + "extensiones").getAbsolutePath()); |
|
1220 |
andamiConfig.setPluginsDirectory(new File(appHomeDir |
|
1221 |
+ "extensiones").getAbsolutePath()); |
|
1221 | 1222 |
} else { |
1222 | 1223 |
andamiConfig.setPluginsDirectory(new File(appName + |
1223 | 1224 |
File.separator + "extensiones").getAbsolutePath()); |
... | ... | |
1998 | 1999 |
org.gvsig.i18n.Messages.addResourceFamily("com.iver.andami.text", "com.iver.andami.text"); |
1999 | 2000 |
|
2000 | 2001 |
} |
2002 |
|
|
2003 |
/** |
|
2004 |
* Gets Home Directory location of the application. |
|
2005 |
* May be set from outside the aplication by means of |
|
2006 |
* -DgvSIG.home=C:/data/gvSIG, where gvSIG its the name |
|
2007 |
* of the application |
|
2008 |
* @return |
|
2009 |
*/ |
|
2010 |
public static String getAppHomeDir() { |
|
2011 |
return appHomeDir; |
|
2012 |
} |
|
2013 |
|
|
2014 |
/** |
|
2015 |
* Sets Home Directory location of the application. |
|
2016 |
* May be set from outside the aplication by means of |
|
2017 |
* -DgvSIG.home=C:/data/gvSIG, where gvSIG its the name |
|
2018 |
* of the application |
|
2019 |
* @param appHomeDir |
|
2020 |
*/ |
|
2021 |
public static void setAppHomeDir(String appHomeDir) { |
|
2022 |
Launcher.appHomeDir = appHomeDir; |
|
2023 |
} |
|
2001 | 2024 |
} |
Also available in: Unified diff