Revision 7682 branches/v10/frameworks/_fwAndami/src/com/iver/andami/Launcher.java
Launcher.java | ||
---|---|---|
46 | 46 |
import java.awt.KeyboardFocusManager; |
47 | 47 |
import java.awt.Point; |
48 | 48 |
import java.awt.Toolkit; |
49 |
import java.io.BufferedInputStream; |
|
50 |
import java.io.BufferedOutputStream; |
|
51 | 49 |
import java.io.BufferedReader; |
52 | 50 |
import java.io.File; |
53 | 51 |
import java.io.FileFilter; |
... | ... | |
151 | 149 |
private static final String nonWinDefaultLookAndFeel = "com.jgoodies.looks.plastic.PlasticXPLookAndFeel"; |
152 | 150 |
|
153 | 151 |
private static ArrayList pluginsOrdered = new ArrayList(); |
152 |
private static String appHomeDir = null; |
|
154 | 153 |
|
155 | 154 |
/** |
156 | 155 |
* DOCUMENT ME! |
... | ... | |
181 | 180 |
appName = args[0]; |
182 | 181 |
|
183 | 182 |
//Se crea el directorio de configuraci?n de la aplicaci?n |
184 |
File parent = new File(System.getProperty("user.home") + |
|
185 |
File.separator + args[0] + File.separator); |
|
183 |
appHomeDir = System.getProperty(args[0]+".home"); |
|
184 |
System.err.println("LWS: "+args[0]+".home"+"="+appHomeDir); |
|
185 |
if (appHomeDir == null) |
|
186 |
System.getProperty("user.home"); |
|
187 |
appHomeDir += File.separator + args[0] + File.separator; |
|
188 |
File parent = new File( appHomeDir ); |
|
186 | 189 |
parent.mkdirs(); |
187 | 190 |
|
188 |
andamiConfigPath = System.getProperty("user.home") + File.separator + |
|
189 |
appName + File.separator + "andami-config.xml"; |
|
190 |
pluginsPersistencePath = System.getProperty("user.home") + |
|
191 |
File.separator + appName + File.separator + |
|
191 |
andamiConfigPath = appHomeDir + "andami-config.xml"; |
|
192 |
pluginsPersistencePath = appHomeDir + |
|
192 | 193 |
"plugins-persistence.xml"; |
193 | 194 |
|
194 | 195 |
// Configurar el log4j |
... | ... | |
197 | 198 |
|
198 | 199 |
PatternLayout l = new PatternLayout("%p %t %C - %m%n"); |
199 | 200 |
RollingFileAppender fa = new RollingFileAppender(l, |
200 |
System.getProperty("user.home") + File.separator + args[0] + |
|
201 |
File.separator + args[0] + ".log", false); |
|
201 |
appHomeDir + args[0] + ".log", false); |
|
202 | 202 |
fa.setMaxFileSize("512KB"); |
203 | 203 |
fa.setMaxBackupIndex(3); |
204 | 204 |
Logger.getRootLogger().addAppender(fa); |
... | ... | |
1209 | 1209 |
|
1210 | 1210 |
if (System.getProperty("javawebstart.version") != null) // Es java web start) |
1211 | 1211 |
{ |
1212 |
andamiConfig.setPluginsDirectory(new File(System.getProperty( |
|
1213 |
"user.home") + File.separator + appName + |
|
1214 |
File.separator + "extensiones").getAbsolutePath()); |
|
1212 |
andamiConfig.setPluginsDirectory(new File(appHomeDir |
|
1213 |
+ "extensiones").getAbsolutePath()); |
|
1215 | 1214 |
} else { |
1216 | 1215 |
andamiConfig.setPluginsDirectory(new File(appName + |
1217 | 1216 |
File.separator + "extensiones").getAbsolutePath()); |
... | ... | |
1999 | 1998 |
org.gvsig.i18n.Messages.addResourceFamily("com.iver.andami.text", "com.iver.andami.text"); |
2000 | 1999 |
|
2001 | 2000 |
} |
2001 |
|
|
2002 |
/** |
|
2003 |
* Gets Home Directory location of the application. |
|
2004 |
* May be set from outside the aplication by means of |
|
2005 |
* -DgvSIG.home=C:/data/gvSIG, where gvSIG its the name |
|
2006 |
* of the application |
|
2007 |
* @return |
|
2008 |
*/ |
|
2009 |
public static String getAppHomeDir() { |
|
2010 |
return appHomeDir; |
|
2011 |
} |
|
2012 |
|
|
2013 |
/** |
|
2014 |
* Sets Home Directory location of the application. |
|
2015 |
* May be set from outside the aplication by means of |
|
2016 |
* -DgvSIG.home=C:/data/gvSIG, where gvSIG its the name |
|
2017 |
* of the application |
|
2018 |
* @param appHomeDir |
|
2019 |
*/ |
|
2020 |
public static void setAppHomeDir(String appHomeDir) { |
|
2021 |
Launcher.appHomeDir = appHomeDir; |
|
2022 |
} |
|
2002 | 2023 |
} |
Also available in: Unified diff