diff --git a/app/src/main/java/io/xpipe/app/browser/BrowserComp.java b/app/src/main/java/io/xpipe/app/browser/BrowserComp.java index cfd0c20af..6e022963f 100644 --- a/app/src/main/java/io/xpipe/app/browser/BrowserComp.java +++ b/app/src/main/java/io/xpipe/app/browser/BrowserComp.java @@ -268,7 +268,7 @@ public class BrowserComp extends SimpleComp { PlatformThread.sync(model.getBusy()))); tab.setGraphic(label); - new FancyTooltipAugment<>(new SimpleStringProperty(model.getId() != null ? model.getId().toString() : null)).augment(label); + new FancyTooltipAugment<>(new SimpleStringProperty(model.getTooltip())).augment(label); GrowAugment.create(true, false).augment(new SimpleCompStructure<>(label)); tab.setContent(new OpenFileSystemComp(model).createSimple()); tab.setText(model.getName()); diff --git a/app/src/main/java/io/xpipe/app/browser/OpenFileSystemModel.java b/app/src/main/java/io/xpipe/app/browser/OpenFileSystemModel.java index 83b7eb961..e1b1efb3e 100644 --- a/app/src/main/java/io/xpipe/app/browser/OpenFileSystemModel.java +++ b/app/src/main/java/io/xpipe/app/browser/OpenFileSystemModel.java @@ -9,7 +9,6 @@ import io.xpipe.app.util.ThreadHelper; import io.xpipe.core.impl.FileNames; import io.xpipe.core.process.ShellControl; import io.xpipe.core.process.ShellDialects; -import io.xpipe.core.source.DataStoreId; import io.xpipe.core.store.*; import javafx.beans.binding.Bindings; import javafx.beans.property.*; @@ -40,14 +39,15 @@ public final class OpenFileSystemModel { private final Property overlay = new SimpleObjectProperty<>(); private final BooleanProperty inOverview = new SimpleBooleanProperty(); private final String name; - private final DataStoreId id; + private final String tooltip; private boolean local; public OpenFileSystemModel(String name, BrowserModel browserModel, FileSystemStore store) { this.browserModel = browserModel; this.store = store; - this.name = name != null ? name : DataStorage.get().getStoreEntry(store).getName(); - this.id = name != null ? null : DataStorage.get().getId(DataStorage.get().getStoreEntry(store)); + var e = DataStorage.get().getStoreEntryIfPresent(store); + this.name = name != null ? name : e.isPresent() ? e.get().getName() : "?"; + this.tooltip = e.isPresent() ? DataStorage.get().getId(e.get()).toString() : name; this.inOverview.bind(Bindings.createBooleanBinding( () -> { return currentPath.get() == null; diff --git a/beacon/src/main/java/io/xpipe/beacon/BeaconClient.java b/beacon/src/main/java/io/xpipe/beacon/BeaconClient.java index 706be511e..5e9515662 100644 --- a/beacon/src/main/java/io/xpipe/beacon/BeaconClient.java +++ b/beacon/src/main/java/io/xpipe/beacon/BeaconClient.java @@ -33,12 +33,12 @@ import static io.xpipe.beacon.BeaconConfig.BODY_SEPARATOR; public class BeaconClient implements AutoCloseable { @Getter - private final Closeable base; + private final AutoCloseable base; private final InputStream in; private final OutputStream out; - private BeaconClient(Closeable base, InputStream in, OutputStream out) { + private BeaconClient(AutoCloseable base, InputStream in, OutputStream out) { this.base = base; this.in = in; this.out = out; @@ -107,7 +107,7 @@ public class BeaconClient implements AutoCloseable { public void close() throws ConnectorException { try { base.close(); - } catch (IOException ex) { + } catch (Exception ex) { throw new ConnectorException("Couldn't close client", ex); } } diff --git a/core/src/main/java/io/xpipe/core/process/ProcessControl.java b/core/src/main/java/io/xpipe/core/process/ProcessControl.java index 05f1e216a..88c6e3b4f 100644 --- a/core/src/main/java/io/xpipe/core/process/ProcessControl.java +++ b/core/src/main/java/io/xpipe/core/process/ProcessControl.java @@ -1,13 +1,12 @@ package io.xpipe.core.process; -import java.io.Closeable; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.nio.charset.Charset; import java.util.concurrent.ExecutorService; -public interface ProcessControl extends Closeable, AutoCloseable { +public interface ProcessControl extends AutoCloseable { @FunctionalInterface interface ExceptionConverter { @@ -37,7 +36,7 @@ public interface ProcessControl extends Closeable, AutoCloseable { void write(byte[] b) throws IOException; @Override - void close() throws IOException; + void close() throws Exception; void kill() throws Exception; diff --git a/core/src/main/java/io/xpipe/core/store/ConnectionFileSystem.java b/core/src/main/java/io/xpipe/core/store/ConnectionFileSystem.java index c32c1058b..0fdc7b6b1 100644 --- a/core/src/main/java/io/xpipe/core/store/ConnectionFileSystem.java +++ b/core/src/main/java/io/xpipe/core/store/ConnectionFileSystem.java @@ -155,7 +155,7 @@ public class ConnectionFileSystem implements FileSystem { // Since we are only closing, just swallow all exceptions try { shellControl.close(); - } catch (IOException ignored) { + } catch (Exception ignored) { } } }