Skip to content
This repository has been archived by the owner on Sep 23, 2020. It is now read-only.

Commit

Permalink
Look for NIMBUS_HOME system property first.
Browse files Browse the repository at this point in the history
Fallback to environment variable.
  • Loading branch information
labisso authored and timf committed Jun 9, 2010
1 parent 7c3f696 commit 93c80f8
Showing 1 changed file with 13 additions and 7 deletions.
Expand Up @@ -25,20 +25,26 @@ public class NimbusHomePathResolver {
private static final Log logger =
LogFactory.getLog(NimbusHomePathResolver.class.getName());

private static String NIMBUS_HOME_ENV_NAME = "NIMBUS_HOME";
public static String NIMBUS_HOME_ENV_NAME = "NIMBUS_HOME";
private static String PATH_PREFIX = "$"+NIMBUS_HOME_ENV_NAME;

private File nimbusHome;

private void initializeNimbusHome() {
final String nimbusHomePath = System.getenv(NIMBUS_HOME_ENV_NAME);
String nimbusHomePath = System.getProperty(NIMBUS_HOME_ENV_NAME);

if (nimbusHomePath == null || nimbusHomePath.trim().length() == 0) {
throw new RuntimeException("The " + NIMBUS_HOME_ENV_NAME +
" environment variable is not set or is empty. " +
"It should be set to the root Nimbus installation " +
"directory by the Nimbus bootstrap scripts."
);

nimbusHomePath = System.getenv(NIMBUS_HOME_ENV_NAME);

if (nimbusHomePath == null || nimbusHomePath.trim().length() == 0) {

throw new RuntimeException("The " + NIMBUS_HOME_ENV_NAME +
" environment variable is not set or is empty. " +
"It should be set to the root Nimbus installation " +
"directory by the Nimbus bootstrap scripts."
);
}
}

this.nimbusHome = new File(nimbusHomePath);
Expand Down

0 comments on commit 93c80f8

Please sign in to comment.