mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-22 07:30:24 +00:00
Small bug fixes
This commit is contained in:
parent
620c30382f
commit
72be31435f
4 changed files with 9 additions and 0 deletions
|
@ -10,6 +10,7 @@ import io.xpipe.core.store.FileSystem;
|
|||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.time.Instant;
|
||||
import java.util.LinkedHashMap;
|
||||
|
@ -40,12 +41,17 @@ public class BrowserFileTransferOperation {
|
|||
public static BrowserFileTransferOperation ofLocal(FileSystem.FileEntry target, List<Path> files, BrowserFileTransferMode transferMode, boolean checkConflicts, Consumer<BrowserTransferProgress> progress) {
|
||||
var entries = files.stream()
|
||||
.map(path -> {
|
||||
if (!Files.exists(path)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
try {
|
||||
return LocalFileSystem.getLocalFileEntry(path);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
})
|
||||
.filter(entry -> entry != null)
|
||||
.toList();
|
||||
return new BrowserFileTransferOperation(target, entries, transferMode, checkConflicts, progress);
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@ public class DesktopApplicationStore extends JacksonizedValue implements DataSto
|
|||
public void checkComplete() throws Throwable {
|
||||
Validators.nonNull(desktop);
|
||||
Validators.isType(desktop, DesktopBaseStore.class);
|
||||
desktop.checkComplete();
|
||||
Validators.nonNull(path);
|
||||
}
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@ public class DesktopCommandStore extends JacksonizedValue implements DataStore,
|
|||
public void checkComplete() throws Throwable {
|
||||
Validators.nonNull(environment);
|
||||
Validators.isType(environment, DesktopEnvironmentStore.class);
|
||||
environment.checkComplete();
|
||||
Validators.nonNull(script);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,6 +36,7 @@ public class DesktopEnvironmentStore extends JacksonizedValue
|
|||
public void checkComplete() throws Throwable {
|
||||
Validators.nonNull(base);
|
||||
Validators.isType(base, DesktopBaseStore.class);
|
||||
base.checkComplete();
|
||||
Validators.nonNull(terminal);
|
||||
Validators.nonNull(dialect);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue