Unverified 提交 068a78d4 authored 作者: Noel Grandin's avatar Noel Grandin 提交者: GitHub

Merge pull request #698 from ashleymercer/master

Fix classpath loading issue #697
......@@ -299,13 +299,15 @@ public class FilePathDisk extends FilePath {
// file name with a colon
if (name.startsWith(CLASSPATH_PREFIX)) {
String fileName = name.substring(CLASSPATH_PREFIX.length());
// Force absolute resolution in Class.getResourceAsStream
if (!fileName.startsWith("/")) {
fileName = "/" + fileName;
}
InputStream in = getClass().getResourceAsStream(fileName);
if (in == null) {
// ClassLoader.getResourceAsStream doesn't need leading "/"
in = Thread.currentThread().getContextClassLoader().
getResourceAsStream(fileName);
getResourceAsStream(fileName.substring(1));
}
if (in == null) {
throw new FileNotFoundException("resource " + fileName);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论