[java-identity-provider] branch master updated: IDP-1642 - Migrate configuration into jars where feasible
Scott Cantor
cantor.2 at osu.edu
Mon Aug 10 19:38:29 UTC 2020
This is an automated email from the git hooks/post-receive script.
scantor pushed a commit to branch master
in repository java-identity-provider.
View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=e9962a522488d4faca81fb553d4e763d2e5154a8
The following commit(s) were added to refs/heads/master by this push:
new e9962a522 IDP-1642 - Migrate configuration into jars where feasible
e9962a522 is described below
commit e9962a522488d4faca81fb553d4e763d2e5154a8
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Mon Aug 10 15:38:59 2020 -0400
IDP-1642 - Migrate configuration into jars where feasible
https://issues.shibboleth.net/jira/browse/IDP-1642
Extend original FlowDefinitionResourceFactory fix.
---
.../factory/FlowDefinitionResourceFactory.java | 26 ++++++++++++----------
1 file changed, 14 insertions(+), 12 deletions(-)
diff --git a/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/factory/FlowDefinitionResourceFactory.java b/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/factory/FlowDefinitionResourceFactory.java
index 5ba5bba31..fadefd614 100644
--- a/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/factory/FlowDefinitionResourceFactory.java
+++ b/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/factory/FlowDefinitionResourceFactory.java
@@ -43,9 +43,8 @@ import net.shibboleth.utilities.java.support.logic.Constraint;
/**
* Derivation of SWF-supplied resource factory for flow definitions.
*
- * <p>
- * This implementation overrides the behavior of the built-in factory with regard to handling absolute paths while still
- * supporting relative paths.
+ * <p>This implementation overrides the behavior of the built-in factory with regard to handling
+ * absolute paths while still supporting relative paths.</p>
*/
public class FlowDefinitionResourceFactory {
@@ -90,19 +89,22 @@ public class FlowDefinitionResourceFactory {
Constraint.isNotEmpty(path, "Flow path cannot be null or empty");
Constraint.isNotEmpty(flowId, "Flow ID cannot be null or empty");
- final Resource resource;
+ Resource resource;
if (basePath == null || isAbsolute(path)) {
resource = resourceLoader.getResource(path);
} else {
- try {
- String localBasePath = basePath;
- if (!localBasePath.endsWith(SLASH)) {
- // the basePath must end with a slash to create a relative resource
- localBasePath = basePath + SLASH;
+ resource = resourceLoader.getResource(path);
+ if (!resource.exists()) {
+ try {
+ String localBasePath = basePath;
+ if (!localBasePath.endsWith(SLASH)) {
+ // the basePath must end with a slash to create a relative resource
+ localBasePath = basePath + SLASH;
+ }
+ resource = resourceLoader.getResource(localBasePath).createRelative(path);
+ } catch (final IOException e) {
+ throw new IllegalStateException("The base path cannot be resolved from '" + basePath + "'", e);
}
- resource = resourceLoader.getResource(localBasePath).createRelative(path);
- } catch (final IOException e) {
- throw new IllegalStateException("The base path cannot be resolved from '" + basePath + "'", e);
}
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list