Small bug fixes

This commit is contained in:
crschnick 2024-05-10 09:49:07 +00:00
parent 620c30382f
commit 72be31435f
4 changed files with 9 additions and 0 deletions

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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);
}
}

View file

@ -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);
}