Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DB181175DC for ; Fri, 10 Apr 2015 13:17:57 +0000 (UTC) Received: (qmail 60836 invoked by uid 500); 10 Apr 2015 13:17:54 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 60764 invoked by uid 500); 10 Apr 2015 13:17:54 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 60751 invoked by uid 99); 10 Apr 2015 13:17:54 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Apr 2015 13:17:54 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 5B1D4E03C2; Fri, 10 Apr 2015 13:17:54 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jbernhardt@apache.org To: commits@cxf.apache.org Date: Fri, 10 Apr 2015 13:17:54 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [1/2] cxf git commit: [CXF-6344] Support system file location for JexlClaimsMapper script 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 Authored: Fri Apr 10 14:36:49 2015 +0200 Committer: Jan Bernhardt 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() {