commit: tries to guess unicorn.home only if not set in the jvm

changeset:   1237:bf4e13ea3f44
tag:         tip
user:        Thomas Gambet <tgambet@w3.org>
date:        Mon Jun 14 10:54:29 2010 -0400
files:       src/org/w3c/unicorn/Framework.java
description:
tries to guess unicorn.home only if not set in the jvm


diff -r 658c2d17219d -r bf4e13ea3f44 src/org/w3c/unicorn/Framework.java
--- a/src/org/w3c/unicorn/Framework.java	Mon Jun 14 10:29:45 2010 -0400
+++ b/src/org/w3c/unicorn/Framework.java	Mon Jun 14 10:54:29 2010 -0400
@@ -125,13 +125,15 @@
 	}
 	
 	public static void initCore() throws InitializationFailedException {
-		try {
-			URL classesDir = Framework.class.getResource("/");
-			File classes = new File(classesDir.toURI());
-			File webInf = new File(classes.getParent());
-			System.setProperty("unicorn.home", webInf.getParent());
-		} catch (URISyntaxException e) {
-			throw new InitializationFailedException(e.getMessage(), e);
+		if (System.getProperty("unicorn.home") == null) {
+			try {
+				URL classesDir = Framework.class.getResource("/");
+				File classes = new File(classesDir.toURI());
+				File webInf = new File(classes.getParent());
+				System.setProperty("unicorn.home", webInf.getParent());
+			} catch (URISyntaxException e) {
+				throw new InitializationFailedException(e.getMessage(), e);
+			}
 		}
 		
 		// Log4j initialization attempt

Received on Monday, 14 June 2010 14:56:29 UTC