cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbernha...@apache.org
Subject [1/2] cxf git commit: [CXF-6344] Support system file location for JexlClaimsMapper script
Date Fri, 10 Apr 2015 13:17:54 GMT
Repository: cxf
Updated Branches:
  refs/heads/2.7.x-fixes 67c7611f6 -> d1c9c572c


[CXF-6344] Support system file location for JexlClaimsMapper script


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

Branch: refs/heads/2.7.x-fixes
Commit: 794d52a4ba787e20313ce3f169e3b465ef8fed86
Parents: 67c7611
Author: Jan Bernhardt <jbernhardt@talend.com>
Authored: Fri Apr 10 14:36:49 2015 +0200
Committer: Jan Bernhardt <jbernhardt@talend.com>
Committed: Fri Apr 10 15:16:13 2015 +0200

----------------------------------------------------------------------
 .../apache/cxf/sts/claims/mapper/JexlClaimsMapper.java   | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/794d52a4/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/mapper/JexlClaimsMapper.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/mapper/JexlClaimsMapper.java
b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/mapper/JexlClaimsMapper.java
index d741534..918e975 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/mapper/JexlClaimsMapper.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/mapper/JexlClaimsMapper.java
@@ -90,11 +90,16 @@ public class JexlClaimsMapper implements ClaimsMapper {
 
     public void setScript(String scriptLocation) throws IOException {
         URL resource = ClassLoaderUtils.getResource(scriptLocation, this.getClass());
-        if (resource == null) {
+        if (resource != null) {
+            scriptLocation = resource.getPath();
+            LOG.fine("Script found within Classpath: " + scriptLocation);
+        }
+        File scriptFile = new File(scriptLocation);
+        if (scriptFile.exists()) {
+            this.script = jexlEngine.createScript(scriptFile);
+        } else {
             throw new IllegalArgumentException("Script resource not found!");
         }
-        
-        this.script = jexlEngine.createScript(new File(resource.getPath()));
     }
 
     public JexlEngine getJexlEngine() {


Mime
View raw message