[java-identity-provider] branch maint-4.1 updated: IDP-1833 - Wildcard classpath breaks inside flow imports on Windows

Scott Cantor cantor.2 at osu.edu
Mon Jul 19 13:50:21 UTC 2021


This is an automated email from the git hooks/post-receive script.

scantor pushed a commit to branch maint-4.1
in repository java-identity-provider.

View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=dfd50c386cc25fb72d4f1df6e16884c644134f01

The following commit(s) were added to refs/heads/maint-4.1 by this push:
       new  dfd50c386 IDP-1833 - Wildcard classpath breaks inside flow imports on Windows
dfd50c386 is described below

commit dfd50c386cc25fb72d4f1df6e16884c644134f01
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Mon Jul 19 09:50:18 2021 -0400

    IDP-1833 - Wildcard classpath breaks inside flow imports on Windows
    
    https://issues.shibboleth.net/jira/browse/IDP-1833
    
    Guard code path with exception catch.
---
 .../spring/factory/FlowRelativeResourceLoader.java   | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/factory/FlowRelativeResourceLoader.java b/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/factory/FlowRelativeResourceLoader.java
index 704c3744a..41a572fab 100644
--- a/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/factory/FlowRelativeResourceLoader.java
+++ b/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/factory/FlowRelativeResourceLoader.java
@@ -58,9 +58,13 @@ class FlowRelativeResourceLoader extends DefaultResourceLoader {
     @Override
     public Resource getResource(final String location) {
         
-        final Resource r = super.getResource(location);
-        if (r.exists()) {
-            return r;
+        try {
+            final Resource r = super.getResource(location);
+            if (r.exists()) {
+                return r;
+            }
+        } catch (final Exception e) {
+            // May happen if resource wrapper throws during exists() call.
         }
         
         if (location.startsWith(CLASSPATH_URL_PREFIX)) {
@@ -92,9 +96,13 @@ class FlowRelativeResourceLoader extends DefaultResourceLoader {
      */
     @Override
     protected Resource getResourceByPath(final String path) {
-        final Resource r = new FileSystemResource(path);
-        if (r.exists()) {
-            return r;
+        try {
+            final Resource r = new FileSystemResource(path);
+            if (r.exists()) {
+                return r;
+            }
+        } catch (final Exception e) {
+            // May happen if resource wrapper throws during exists() call.
         }
         return super.getResourceByPath(path);
     }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list