Rework ssh file path handling

This commit is contained in:
crschnick 2024-01-17 16:35:27 +00:00
parent de6c71fc5d
commit 37ed575266

View file

@ -49,7 +49,7 @@ public class ContextualFileReference {
public static Optional<String> resolveIfInDataDirectory(ShellControl shellControl, String s) {
if (s.contains("<DATA>")) {
var cf = of(s);
return Optional.of(cf.toFilePath(shellControl));
return Optional.of(cf.toAbsoluteFilePath(shellControl));
} else {
return Optional.empty();
}
@ -76,7 +76,7 @@ public class ContextualFileReference {
@NonNull
private final String path;
public String toFilePath(ShellControl sc) {
public String toAbsoluteFilePath(ShellControl sc) {
return path.replaceAll("/", Matcher.quoteReplacement(sc != null ? sc.getOsType().getFileSystemSeparator() : "/"));
}