incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h...@apache.org
Subject [1/2] git commit: Summary: small fix for the classpath loader
Date Mon, 07 Jan 2013 21:22:55 GMT
Summary: small fix for the classpath loader

Add the file separator if the path does not end with one


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/d616dcdd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/d616dcdd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/d616dcdd

Branch: refs/heads/master
Commit: d616dcdd40793e5fb07aab7182a9deac5c03ea37
Parents: d5ac10d
Author: Hugo Trippaers <htrippaers@schubergphilis.com>
Authored: Mon Jan 7 22:16:05 2013 +0100
Committer: Hugo Trippaers <htrippaers@schubergphilis.com>
Committed: Mon Jan 7 22:17:55 2013 +0100

----------------------------------------------------------------------
 utils/src/com/cloud/utils/script/Script.java |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/d616dcdd/utils/src/com/cloud/utils/script/Script.java
----------------------------------------------------------------------
diff --git a/utils/src/com/cloud/utils/script/Script.java b/utils/src/com/cloud/utils/script/Script.java
index a0f9e8e..1444f83 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<String> {
          * 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 {


Mime
View raw message