mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-08-22 01:06:34 +00:00
Various fixes
This commit is contained in:
@@ -161,6 +161,8 @@ public interface ShellDialect {
|
||||
|
||||
CommandControl deleteFileOrDirectory(ShellControl sc, String file);
|
||||
|
||||
String clearDisplayCommand();
|
||||
|
||||
CommandControl createFileExistsCommand(ShellControl sc, String file);
|
||||
|
||||
CommandControl symbolicLink(ShellControl sc, String linkFile, String targetFile);
|
||||
|
||||
@@ -92,7 +92,9 @@ public class ConnectionFileSystem implements FileSystem {
|
||||
|
||||
@Override
|
||||
public void delete(String file) throws Exception {
|
||||
try (var pc = shellControl.getShellDialect().deleteFileOrDirectory(shellControl, file)
|
||||
try (var pc = shellControl
|
||||
.getShellDialect()
|
||||
.deleteFileOrDirectory(shellControl, file)
|
||||
.start()) {
|
||||
pc.discardOrThrow();
|
||||
}
|
||||
@@ -139,14 +141,21 @@ public class ConnectionFileSystem implements FileSystem {
|
||||
|
||||
@Override
|
||||
public void symbolicLink(String linkFile, String targetFile) throws Exception {
|
||||
try (var pc = shellControl.getShellDialect().symbolicLink(shellControl,linkFile, targetFile)
|
||||
try (var pc = shellControl
|
||||
.getShellDialect()
|
||||
.symbolicLink(shellControl, linkFile, targetFile)
|
||||
.start()) {
|
||||
pc.discardOrThrow();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() throws IOException {
|
||||
shellControl.close();
|
||||
public void close() {
|
||||
// In case the shell control is already in an invalid state, this operation might fail
|
||||
// Since we are only closing, just swallow all exceptions
|
||||
try {
|
||||
shellControl.close();
|
||||
} catch (IOException ignored) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user