mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-10-06 15:11:38 +00:00
Rework ssh file path handling
This commit is contained in:
1 parent
de6c71fc5d
commit
37ed575266
1 file changed
+2
-2
@@ -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() : "/"));
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user