mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-07 09:06:03 +00:00
Use different approach for relativize two paths due to Java 11
This commit is contained in:
1 parent
ead5dba939
commit
9e8df1aebc
2 files changed
+16
-2
No files matched your search
@@ -3322,8 +3322,14 @@ public final class FilePath implements Serializable {
|
||||
while (!remainingPath.isEmpty()) {
|
||||
Path directChild = this.getDirectChild(currentFilePath, remainingPath);
|
||||
Path childUsingFullPath = currentFilePath.resolve(remainingPath);
|
||||
Path rel = directChild.toAbsolutePath().relativize(childUsingFullPath.toAbsolutePath());
|
||||
remainingPath = rel.toString();
|
||||
String childUsingFullPathAbs = childUsingFullPath.toAbsolutePath().toString();
|
||||
String directChildAbs = directChild.toAbsolutePath().toString();
|
||||
|
||||
if (childUsingFullPathAbs.length() == directChildAbs.length()) {
|
||||
remainingPath = "";
|
||||
} else {
|
||||
remainingPath = childUsingFullPathAbs.substring(directChildAbs.length() + 1);
|
||||
}
|
||||
|
||||
File childFileSymbolic = Util.resolveSymlinkToFile(directChild.toFile());
|
||||
if (childFileSymbolic == null) {
|
||||
|
||||
Reference in new issue
Block a user