Repository: cxf-fediz
Updated Branches:
  refs/heads/1.2.x-fixes 994fcc8f2 -> 54ad62c98


[FEDIZ-161] - FederationConfigImpl.init() calls loadConfig(File) which fails 
for war files with special characters in its name


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

Branch: refs/heads/1.2.x-fixes
Commit: 54ad62c98b1085bfcc3535e007dfa5beed3af276
Parents: 994fcc8
Author: Colm O hEigeartaigh <cohei...@apache.org>
Authored: Wed Apr 6 17:50:23 2016 +0100
Committer: Colm O hEigeartaigh <cohei...@apache.org>
Committed: Wed Apr 6 18:03:55 2016 +0100

----------------------------------------------------------------------
 .../org/apache/cxf/fediz/core/config/FedizConfigurator.java   | 6 ++++--
 .../org/apache/cxf/fediz/jetty/FederationAuthenticator.java   | 7 +++++++
 .../org/apache/cxf/fediz/tomcat/FederationAuthenticator.java  | 3 +++
 3 files changed, 14 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/54ad62c9/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 d69b73a..8cd0b91 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
@@ -20,6 +20,8 @@
 package org.apache.cxf.fediz.core.config;
 
 import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
 import java.io.Reader;
 import java.io.Writer;
 import java.util.ArrayList;
@@ -39,8 +41,8 @@ public class FedizConfigurator {
     
     private List<FedizContext> fedizContextList;
 
-    public FedizConfig loadConfig(File f) throws JAXBException {
-        rootConfig = (FedizConfig) 
getJaxbContext().createUnmarshaller().unmarshal(f);
+    public FedizConfig loadConfig(File f) throws JAXBException, 
FileNotFoundException {
+        rootConfig = (FedizConfig) 
getJaxbContext().createUnmarshaller().unmarshal(new FileInputStream(f));
         parseFedizContextList();
         return rootConfig;
     }

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/54ad62c9/plugins/jetty/src/main/java/org/apache/cxf/fediz/jetty/FederationAuthenticator.java
----------------------------------------------------------------------
diff --git 
a/plugins/jetty/src/main/java/org/apache/cxf/fediz/jetty/FederationAuthenticator.java
 
b/plugins/jetty/src/main/java/org/apache/cxf/fediz/jetty/FederationAuthenticator.java
index 10f99da..75b19ed 100644
--- 
a/plugins/jetty/src/main/java/org/apache/cxf/fediz/jetty/FederationAuthenticator.java
+++ 
b/plugins/jetty/src/main/java/org/apache/cxf/fediz/jetty/FederationAuthenticator.java
@@ -20,6 +20,7 @@
 package org.apache.cxf.fediz.jetty;
 
 import java.io.File;
+import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.PrintWriter;
@@ -124,6 +125,12 @@ public class FederationAuthenticator extends 
LoginAuthenticator {
                     e);
             //throw new ServerAuthException("Failed to load Fediz 
configuration",
             //                              e);
+        } catch (FileNotFoundException e) {
+            //[TODO] use other exception
+            throw new RuntimeException("Failed to load Fediz configuration",
+                    e);
+            //throw new ServerAuthException("Failed to load Fediz 
configuration",
+            //                              e);
         }
         
     }

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/54ad62c9/plugins/tomcat7/src/main/java/org/apache/cxf/fediz/tomcat/FederationAuthenticator.java
----------------------------------------------------------------------
diff --git 
a/plugins/tomcat7/src/main/java/org/apache/cxf/fediz/tomcat/FederationAuthenticator.java
 
b/plugins/tomcat7/src/main/java/org/apache/cxf/fediz/tomcat/FederationAuthenticator.java
index fb317de..7efd5ba 100644
--- 
a/plugins/tomcat7/src/main/java/org/apache/cxf/fediz/tomcat/FederationAuthenticator.java
+++ 
b/plugins/tomcat7/src/main/java/org/apache/cxf/fediz/tomcat/FederationAuthenticator.java
@@ -20,6 +20,7 @@
 package org.apache.cxf.fediz.tomcat;
 
 import java.io.File;
+import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.security.Principal;
 import java.util.Date;
@@ -125,6 +126,8 @@ public class FederationAuthenticator extends 
FormAuthenticator {
             LOG.debug("Fediz configuration read from " + f.getAbsolutePath());
         } catch (JAXBException e) {
             throw new LifecycleException("Failed to load Fediz configuration", 
e);
+        } catch (FileNotFoundException e) {
+            throw new LifecycleException("Failed to load Fediz configuration", 
e);
         }
         super.startInternal();
 

Reply via email to