cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbernha...@apache.org
Subject [1/4] cxf-fediz git commit: [FEDIZ-118] Improve configuration file handling for root context applications
Date Tue, 05 May 2015 14:26:43 GMT
Repository: cxf-fediz
Updated Branches:
  refs/heads/master e9dd16121 -> 5ad84a6ff


[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/90636de0
Tree: http://git-wip-us.apache.org/repos/asf/cxf-fediz/tree/90636de0
Diff: http://git-wip-us.apache.org/repos/asf/cxf-fediz/diff/90636de0

Branch: refs/heads/master
Commit: 90636de0a4bc25c4a6b3af99ce66cd40c1a69dd9
Parents: 98dfb01
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 15:02:58 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/90636de0/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