[Yanel-commits] rev 49793 -
public/yanel/trunk/src/core/java/org/wyona/yanel/core/map
michi at wyona.com
michi at wyona.com
Sun May 23 16:31:38 CEST 2010
Author: michi
Date: 2010-05-23 16:31:38 +0200 (Sun, 23 May 2010)
New Revision: 49793
Modified:
public/yanel/trunk/src/core/java/org/wyona/yanel/core/map/RealmManager.java
Log:
also check within the user home directory
Modified: public/yanel/trunk/src/core/java/org/wyona/yanel/core/map/RealmManager.java
===================================================================
--- public/yanel/trunk/src/core/java/org/wyona/yanel/core/map/RealmManager.java 2010-05-23 11:51:22 UTC (rev 49792)
+++ public/yanel/trunk/src/core/java/org/wyona/yanel/core/map/RealmManager.java 2010-05-23 14:31:38 UTC (rev 49793)
@@ -85,6 +85,8 @@
* @return Realms configuration file, either something like /usr/local/tomcat/webapps/yanel/WEB-INF/classes/realms.xml or /home/foo/realms.xml
*/
private File getRealmsConfigFile(String yanelConfigurationFilename) throws ConfigurationException {
+
+ // 1.) Getting realms.xml from environment variable YANEL_REALMS_HOME
java.util.Map<String, String> env = System.getenv();
for (String envName : env.keySet()) {
if (envName.equals("YANEL_REALMS_HOME")) {
@@ -94,12 +96,27 @@
if (envRealmsConfigFile.isFile()) {
log.warn("Use environment variable YANEL_REALMS_HOME: " + yanelRealmsHome);
return envRealmsConfigFile;
+ } else {
+ log.warn("No realms configuration found: " + envRealmsConfigFile.getAbsolutePath());
}
break;
}
}
}
+
+ // 2.) Getting realms.xml from user home directory
+ log.warn("DEBUG: User home directory: " + System.getProperty("user.home"));
+ File userHomeRealmsConfigFile = new File(System.getProperty("user.home"), "realms.xml");
+ if (userHomeRealmsConfigFile.isFile()) {
+ log.warn("Use user home directory: " + System.getProperty("user.home"));
+ return userHomeRealmsConfigFile;
+ } else {
+ log.warn("No realms configuration found within user home directory: " + userHomeRealmsConfigFile.getAbsolutePath());
+ }
+
+
+ // 3.) Getting realms.xml from yanel.xml
YANEL_CONFIGURATION_FILE = yanelConfigurationFilename;
if (RealmManager.class.getClassLoader().getResource(YANEL_CONFIGURATION_FILE) == null) {
More information about the Yanel-commits
mailing list