|
@@ -90,10 +90,8 @@ public class RawLocalFs extends DelegateToFileSystem {
|
|
// NB: Use createSymbolicLink in java.nio.file.Path once available
|
|
// NB: Use createSymbolicLink in java.nio.file.Path once available
|
|
try {
|
|
try {
|
|
Shell.execCommand(Shell.getSymlinkCommand(
|
|
Shell.execCommand(Shell.getSymlinkCommand(
|
|
- new URI(target.toString()).getPath(),
|
|
|
|
- new URI(link.toString()).getPath()));
|
|
|
|
- } catch (URISyntaxException x) {
|
|
|
|
- throw new IOException("Invalid symlink path: "+x.getMessage());
|
|
|
|
|
|
+ getPathWithoutSchemeAndAuthority(target),
|
|
|
|
+ getPathWithoutSchemeAndAuthority(link)));
|
|
} catch (IOException x) {
|
|
} catch (IOException x) {
|
|
throw new IOException("Unable to create symlink: "+x.getMessage());
|
|
throw new IOException("Unable to create symlink: "+x.getMessage());
|
|
}
|
|
}
|
|
@@ -168,4 +166,13 @@ public class RawLocalFs extends DelegateToFileSystem {
|
|
*/
|
|
*/
|
|
throw new AssertionError();
|
|
throw new AssertionError();
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ private static String getPathWithoutSchemeAndAuthority(Path path) {
|
|
|
|
+ // This code depends on Path.toString() to remove the leading slash before
|
|
|
|
+ // the drive specification on Windows.
|
|
|
|
+ Path newPath = path.isUriPathAbsolute() ?
|
|
|
|
+ new Path(null, null, path.toUri().getPath()) :
|
|
|
|
+ path;
|
|
|
|
+ return newPath.toString();
|
|
|
|
+ }
|
|
}
|
|
}
|