Repository: cxf-fediz Updated Branches: refs/heads/master d132e1b53 -> 4c20cefb8
[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/4c20cefb Tree: http://git-wip-us.apache.org/repos/asf/cxf-fediz/tree/4c20cefb Diff: http://git-wip-us.apache.org/repos/asf/cxf-fediz/diff/4c20cefb Branch: refs/heads/master Commit: 4c20cefb8369a79f946b13ba7c8f2d03b605c1c5 Parents: d132e1b Author: Colm O hEigeartaigh <[email protected]> Authored: Wed Apr 6 17:50:23 2016 +0100 Committer: Colm O hEigeartaigh <[email protected]> Committed: Wed Apr 6 17:50:23 2016 +0100 ---------------------------------------------------------------------- .../org/apache/cxf/fediz/core/config/FedizConfigurator.java | 6 ++++-- .../org/apache/cxf/fediz/jetty8/FederationAuthenticator.java | 3 ++- .../org/apache/cxf/fediz/jetty9/FederationAuthenticator.java | 3 ++- .../org/apache/cxf/fediz/tomcat7/FederationAuthenticator.java | 3 ++- .../org/apache/cxf/fediz/tomcat8/FederationAuthenticator.java | 3 ++- 5 files changed, 12 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/4c20cefb/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 3652a01..3e19f57 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/4c20cefb/plugins/jetty8/src/main/java/org/apache/cxf/fediz/jetty8/FederationAuthenticator.java ---------------------------------------------------------------------- diff --git a/plugins/jetty8/src/main/java/org/apache/cxf/fediz/jetty8/FederationAuthenticator.java b/plugins/jetty8/src/main/java/org/apache/cxf/fediz/jetty8/FederationAuthenticator.java index c9f69cb..6b206eb 100644 --- a/plugins/jetty8/src/main/java/org/apache/cxf/fediz/jetty8/FederationAuthenticator.java +++ b/plugins/jetty8/src/main/java/org/apache/cxf/fediz/jetty8/FederationAuthenticator.java @@ -20,6 +20,7 @@ package org.apache.cxf.fediz.jetty8; import java.io.File; +import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.io.UnsupportedEncodingException; @@ -115,7 +116,7 @@ public class FederationAuthenticator extends LoginAuthenticator { configurator = new FedizConfigurator(); configurator.loadConfig(f); LOG.debug("Fediz configuration read from " + f.getAbsolutePath()); - } catch (JAXBException e) { + } catch (JAXBException | FileNotFoundException e) { //[TODO] use other exception throw new RuntimeException("Failed to load Fediz configuration", e); http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/4c20cefb/plugins/jetty9/src/main/java/org/apache/cxf/fediz/jetty9/FederationAuthenticator.java ---------------------------------------------------------------------- diff --git a/plugins/jetty9/src/main/java/org/apache/cxf/fediz/jetty9/FederationAuthenticator.java b/plugins/jetty9/src/main/java/org/apache/cxf/fediz/jetty9/FederationAuthenticator.java index df8f000..d25eced 100644 --- a/plugins/jetty9/src/main/java/org/apache/cxf/fediz/jetty9/FederationAuthenticator.java +++ b/plugins/jetty9/src/main/java/org/apache/cxf/fediz/jetty9/FederationAuthenticator.java @@ -20,6 +20,7 @@ package org.apache.cxf.fediz.jetty9; import java.io.File; +import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.io.UnsupportedEncodingException; @@ -114,7 +115,7 @@ public class FederationAuthenticator extends LoginAuthenticator { configurator = new FedizConfigurator(); configurator.loadConfig(f); LOG.debug("Fediz configuration read from " + f.getAbsolutePath()); - } catch (JAXBException e) { + } catch (JAXBException | FileNotFoundException e) { //[TODO] use other exception throw new RuntimeException("Failed to load Fediz configuration", e); http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/4c20cefb/plugins/tomcat7/src/main/java/org/apache/cxf/fediz/tomcat7/FederationAuthenticator.java ---------------------------------------------------------------------- diff --git a/plugins/tomcat7/src/main/java/org/apache/cxf/fediz/tomcat7/FederationAuthenticator.java b/plugins/tomcat7/src/main/java/org/apache/cxf/fediz/tomcat7/FederationAuthenticator.java index 3ab6f97..c58bccb 100644 --- a/plugins/tomcat7/src/main/java/org/apache/cxf/fediz/tomcat7/FederationAuthenticator.java +++ b/plugins/tomcat7/src/main/java/org/apache/cxf/fediz/tomcat7/FederationAuthenticator.java @@ -20,6 +20,7 @@ package org.apache.cxf.fediz.tomcat7; import java.io.File; +import java.io.FileNotFoundException; import java.io.IOException; import java.security.Principal; import java.util.Date; @@ -123,7 +124,7 @@ public class FederationAuthenticator extends FormAuthenticator { configurator = new FedizConfigurator(); configurator.loadConfig(f); LOG.debug("Fediz configuration read from " + f.getAbsolutePath()); - } catch (JAXBException e) { + } catch (JAXBException | FileNotFoundException e) { throw new LifecycleException("Failed to load Fediz configuration", e); } super.startInternal(); http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/4c20cefb/plugins/tomcat8/src/main/java/org/apache/cxf/fediz/tomcat8/FederationAuthenticator.java ---------------------------------------------------------------------- diff --git a/plugins/tomcat8/src/main/java/org/apache/cxf/fediz/tomcat8/FederationAuthenticator.java b/plugins/tomcat8/src/main/java/org/apache/cxf/fediz/tomcat8/FederationAuthenticator.java index 4d173ab..6bcdeb8 100644 --- a/plugins/tomcat8/src/main/java/org/apache/cxf/fediz/tomcat8/FederationAuthenticator.java +++ b/plugins/tomcat8/src/main/java/org/apache/cxf/fediz/tomcat8/FederationAuthenticator.java @@ -20,6 +20,7 @@ package org.apache.cxf.fediz.tomcat8; import java.io.File; +import java.io.FileNotFoundException; import java.io.IOException; import java.security.Principal; import java.util.Date; @@ -114,7 +115,7 @@ public class FederationAuthenticator extends FormAuthenticator { configurator = new FedizConfigurator(); configurator.loadConfig(f); LOG.debug("Fediz configuration read from " + f.getAbsolutePath()); - } catch (JAXBException e) { + } catch (JAXBException | FileNotFoundException e) { throw new LifecycleException("Failed to load Fediz configuration", e); } super.startInternal();
