mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-04-25 00:52:31 -04:00
Merge branch 1.7.5 into master [release]
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
package io.xpipe.core.process;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.InputStream;
|
||||
|
||||
public class BufferedProcessInputStream extends BufferedInputStream {
|
||||
|
||||
public BufferedProcessInputStream(InputStream in, int size) {
|
||||
super(in, size);
|
||||
}
|
||||
|
||||
public int bufferedAvailable() {
|
||||
return count - pos;
|
||||
}
|
||||
}
|
||||
@@ -21,6 +21,10 @@ public interface ShellControl extends ProcessControl {
|
||||
|
||||
ShellDialect getTargetTerminalShellDialect();
|
||||
|
||||
BufferedProcessInputStream getStdout();
|
||||
|
||||
BufferedProcessInputStream getStderr();
|
||||
|
||||
default boolean hasLocalSystemAccess() {
|
||||
return getSystemId().equals(XPipeSystemId.getLocal());
|
||||
}
|
||||
|
||||
@@ -84,7 +84,6 @@ public class ConnectionFileSystem implements FileSystem {
|
||||
try (var pc = shellControl
|
||||
.getShellDialect()
|
||||
.createFileExistsCommand(shellControl, file)
|
||||
.complex()
|
||||
.start()) {
|
||||
return pc.discardAndCheckExit();
|
||||
}
|
||||
@@ -124,7 +123,6 @@ public class ConnectionFileSystem implements FileSystem {
|
||||
public void mkdirs(String file) throws Exception {
|
||||
try (var pc = shellControl
|
||||
.command(proc -> proc.getShellDialect().getMkdirsCommand(file))
|
||||
.complex()
|
||||
.start()) {
|
||||
pc.discardOrThrow();
|
||||
}
|
||||
|
||||
@@ -115,7 +115,10 @@ public interface FileSystem extends Closeable, AutoCloseable {
|
||||
Stream<FileEntry> listFiles(String file) throws Exception;
|
||||
|
||||
default List<FileEntry> listFilesRecursively(String file) throws Exception {
|
||||
var base = listFiles(file).toList();
|
||||
List<FileEntry> base;
|
||||
try (var filesStream = listFiles(file)) {
|
||||
base = filesStream.toList();
|
||||
}
|
||||
return base.stream()
|
||||
.flatMap(fileEntry -> {
|
||||
if (fileEntry.getKind() != FileKind.DIRECTORY) {
|
||||
|
||||
Reference in New Issue
Block a user