From d616dcdd40793e5fb07aab7182a9deac5c03ea37 Mon Sep 17 00:00:00 2001 From: Hugo Trippaers Date: Mon, 7 Jan 2013 22:16:05 +0100 Subject: [PATCH] Summary: small fix for the classpath loader Add the file separator if the path does not end with one --- utils/src/com/cloud/utils/script/Script.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/utils/src/com/cloud/utils/script/Script.java b/utils/src/com/cloud/utils/script/Script.java index a0f9e8e3e88..1444f83f425 100755 --- a/utils/src/com/cloud/utils/script/Script.java +++ b/utils/src/com/cloud/utils/script/Script.java @@ -350,7 +350,12 @@ public class Script implements Callable { * Look in WEB-INF/classes of the webapp * URI workaround the URL encoding of url.getFile */ - url = Script.class.getClassLoader().getResource(path + script); + if (path.endsWith(File.separator)) { + url = Script.class.getClassLoader().getResource(path + script); + } + else { + url = Script.class.getClassLoader().getResource(path + File.separator + script); + } s_logger.debug("Classpath resource: " + url); if (url != null) { try {