Skip to content

Commit d616dcd

Browse files
committed
Summary: small fix for the classpath loader
Add the file separator if the path does not end with one
1 parent d5ac10d commit d616dcd

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

utils/src/com/cloud/utils/script/Script.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,12 @@ public static String findScript(String path, String script) {
350350
* Look in WEB-INF/classes of the webapp
351351
* URI workaround the URL encoding of url.getFile
352352
*/
353-
url = Script.class.getClassLoader().getResource(path + script);
353+
if (path.endsWith(File.separator)) {
354+
url = Script.class.getClassLoader().getResource(path + script);
355+
}
356+
else {
357+
url = Script.class.getClassLoader().getResource(path + File.separator + script);
358+
}
354359
s_logger.debug("Classpath resource: " + url);
355360
if (url != null) {
356361
try {

0 commit comments

Comments
 (0)