mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-09-30 00:56:56 +13:00
Rework ssh file path handling
This commit is contained in:
parent
de6c71fc5d
commit
37ed575266
1 changed files with 2 additions and 2 deletions
|
@ -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() : "/"));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue