From 63d74e5db5a38672c221467d51a737bc019df38d Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Tue, 1 Oct 2019 15:12:04 +0200 Subject: inject ResourceLoader to facilitate Spring based resource loading --- .../egiz/eaaf/core/impl/idp/auth/modules/AbstractAuthServletTask.java | 2 ++ .../src/main/java/at/gv/egiz/eaaf/core/impl/utils/FileUtils.java | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/modules/AbstractAuthServletTask.java b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/modules/AbstractAuthServletTask.java index 5027a84b..ce9ba57c 100644 --- a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/modules/AbstractAuthServletTask.java +++ b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/modules/AbstractAuthServletTask.java @@ -47,6 +47,7 @@ import org.apache.commons.lang3.ArrayUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.io.ResourceLoader; import at.gv.egiz.eaaf.core.api.IRequest; import at.gv.egiz.eaaf.core.api.IRequestStorage; @@ -71,6 +72,7 @@ public abstract class AbstractAuthServletTask extends AbstractTask { @Autowired(required=true) IProtocolAuthenticationService protAuchService; @Autowired(required=true) protected IRequestStorage requestStoreage; @Autowired(required=true) protected IConfiguration authConfig; + @Autowired(required=true) protected ResourceLoader resourceLoader; @Autowired protected IRevisionLogger revisionsLogger; diff --git a/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/utils/FileUtils.java b/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/utils/FileUtils.java index fff83e53..6ac51ac4 100644 --- a/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/utils/FileUtils.java +++ b/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/utils/FileUtils.java @@ -121,7 +121,8 @@ public class FileUtils { if(null == url) return null; - if (url.startsWith("http:") || url.startsWith("https:") || url.startsWith("file:") || url.startsWith("ftp:")) { + if (url.startsWith("http:") || url.startsWith("https:") || url.startsWith("file:") + || url.startsWith("ftp:") || url.startsWith("classpath:")) { return url; } else { -- cgit v1.2.3