cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbernha...@apache.org
Subject [1/2] cxf-fediz git commit: [FEDIZ-118] Improve configuration file handling for root context applications
Date Tue, 05 May 2015 14:36:47 GMT
Repository: cxf-fediz
Updated Branches:
  refs/heads/1.2.x-fixes 6b2460973 -> e568c0481


[FEDIZ-118] Improve configuration file handling for root context applications


Project: http://git-wip-us.apache.org/repos/asf/cxf-fediz/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf-fediz/commit/e568c048
Tree: http://git-wip-us.apache.org/repos/asf/cxf-fediz/tree/e568c048
Diff: http://git-wip-us.apache.org/repos/asf/cxf-fediz/diff/e568c048

Branch: refs/heads/1.2.x-fixes
Commit: e568c0481a1c6a2f701d2a404f68b339cc7eb503
Parents: decd36f
Author: Jan Bernhardt <jbernhardt@talend.com>
Authored: Tue May 5 10:38:12 2015 +0200
Committer: Jan Bernhardt <jbernhardt@talend.com>
Committed: Tue May 5 16:28:04 2015 +0200

----------------------------------------------------------------------
 .../apache/cxf/fediz/core/config/FedizConfigurator.java | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/e568c048/plugins/core/src/main/java/org/apache/cxf/fediz/core/config/FedizConfigurator.java
----------------------------------------------------------------------
diff --git a/plugins/core/src/main/java/org/apache/cxf/fediz/core/config/FedizConfigurator.java
b/plugins/core/src/main/java/org/apache/cxf/fediz/core/config/FedizConfigurator.java
index 7d3666a..d69b73a 100644
--- a/plugins/core/src/main/java/org/apache/cxf/fediz/core/config/FedizConfigurator.java
+++ b/plugins/core/src/main/java/org/apache/cxf/fediz/core/config/FedizConfigurator.java
@@ -81,7 +81,10 @@ public class FedizConfigurator {
     
     public FedizContext getFedizContext(String contextName) {
         if (contextName == null) {
-            throw new IllegalArgumentException("Invalid Context Name '" + contextName + "'");
+            throw new IllegalArgumentException("Context Name cannot be 'null'.");
+        }
+        if (contextName.isEmpty()) {
+            contextName = "/";
         }
         if (rootConfig == null) {
             throw new IllegalArgumentException("No configuration loaded");
@@ -97,8 +100,11 @@ public class FedizConfigurator {
     }
 
     public ContextConfig getContextConfig(String contextName) throws IllegalArgumentException
{
-        if (contextName == null || contextName.isEmpty()) {
-            throw new IllegalArgumentException("Invalid Context Name '" + contextName + "'");
+        if (contextName == null) {
+            throw new IllegalArgumentException("Context Name cannot be 'null'.");
+        }
+        if (contextName.isEmpty()) {
+            contextName = "/";
         }
         if (rootConfig == null) {
             throw new IllegalArgumentException("No configuration loaded");


Mime
View raw message