diff --git a/app/src/main/java/io/xpipe/app/browser/action/impl/BrowseInNativeManagerActionProvider.java b/app/src/main/java/io/xpipe/app/browser/action/impl/BrowseInNativeManagerActionProvider.java index 59b685db9..5775e47d6 100644 --- a/app/src/main/java/io/xpipe/app/browser/action/impl/BrowseInNativeManagerActionProvider.java +++ b/app/src/main/java/io/xpipe/app/browser/action/impl/BrowseInNativeManagerActionProvider.java @@ -4,7 +4,6 @@ import io.xpipe.app.browser.action.BrowserAction; import io.xpipe.app.browser.action.BrowserActionProvider; import io.xpipe.app.browser.file.BrowserEntry; import io.xpipe.app.browser.file.BrowserFileSystemTabModel; -import io.xpipe.app.process.LocalShell; import io.xpipe.app.process.ShellControl; import io.xpipe.app.util.DesktopHelper; diff --git a/app/src/main/java/io/xpipe/app/browser/action/impl/OpenFileNativeManagerActionProvider.java b/app/src/main/java/io/xpipe/app/browser/action/impl/OpenFileNativeManagerActionProvider.java index b59cdb2b0..4e1b7bc80 100644 --- a/app/src/main/java/io/xpipe/app/browser/action/impl/OpenFileNativeManagerActionProvider.java +++ b/app/src/main/java/io/xpipe/app/browser/action/impl/OpenFileNativeManagerActionProvider.java @@ -4,12 +4,9 @@ import io.xpipe.app.browser.action.BrowserAction; import io.xpipe.app.browser.action.BrowserActionProvider; import io.xpipe.app.browser.file.BrowserEntry; import io.xpipe.app.browser.file.BrowserFileSystemTabModel; -import io.xpipe.app.ext.FileKind; -import io.xpipe.app.process.CommandBuilder; -import io.xpipe.app.process.LocalShell; import io.xpipe.app.process.ShellControl; import io.xpipe.app.util.DesktopHelper; -import io.xpipe.core.OsType; + import lombok.experimental.SuperBuilder; import lombok.extern.jackson.Jacksonized; diff --git a/app/src/main/java/io/xpipe/app/core/AppRestart.java b/app/src/main/java/io/xpipe/app/core/AppRestart.java index 0c618a945..1e787105e 100644 --- a/app/src/main/java/io/xpipe/app/core/AppRestart.java +++ b/app/src/main/java/io/xpipe/app/core/AppRestart.java @@ -5,7 +5,6 @@ import io.xpipe.app.process.LocalShell; import io.xpipe.app.process.ShellDialect; import io.xpipe.app.process.ShellDialects; import io.xpipe.app.update.AppDistributionType; -import io.xpipe.app.util.DesktopShortcuts; import io.xpipe.core.OsType; import java.util.List; diff --git a/app/src/main/java/io/xpipe/app/core/AppTheme.java b/app/src/main/java/io/xpipe/app/core/AppTheme.java index 25332ade7..77072f6a9 100644 --- a/app/src/main/java/io/xpipe/app/core/AppTheme.java +++ b/app/src/main/java/io/xpipe/app/core/AppTheme.java @@ -59,10 +59,12 @@ public class AppTheme { } stage.getScene().rootProperty().subscribe(parent -> { - applyClasses(parent, AppPrefs.get().theme().getValue(), AppPrefs.get().performanceMode().getValue()); + applyClasses( + parent, + AppPrefs.get().theme().getValue(), + AppPrefs.get().performanceMode().getValue()); }); - // Allow for GC var ref = new WeakReference<>(stage); @@ -94,8 +96,7 @@ public class AppTheme { return; } - r.pseudoClassStateChanged( - PseudoClass.getPseudoClass(OsType.ofLocal().getId()), true); + r.pseudoClassStateChanged(PseudoClass.getPseudoClass(OsType.ofLocal().getId()), true); Theme.ALL.forEach(theme -> { r.pseudoClassStateChanged( diff --git a/app/src/main/java/io/xpipe/app/hub/comp/StoreCategoryComp.java b/app/src/main/java/io/xpipe/app/hub/comp/StoreCategoryComp.java index 3dfea270f..c379a2d79 100644 --- a/app/src/main/java/io/xpipe/app/hub/comp/StoreCategoryComp.java +++ b/app/src/main/java/io/xpipe/app/hub/comp/StoreCategoryComp.java @@ -211,8 +211,8 @@ public class StoreCategoryComp extends SimpleComp { if (AppPrefs.get().developerMode().getValue()) { var browse = new MenuItem(AppI18n.get("browseInternalStorage"), new FontIcon("mdi2f-folder-open-outline")); - browse.setOnAction(event -> - DesktopHelper.browseFile(category.getCategory().getDirectory())); + browse.setOnAction( + event -> DesktopHelper.browseFile(category.getCategory().getDirectory())); contextMenu.getItems().add(browse); } diff --git a/app/src/main/java/io/xpipe/app/hub/comp/StoreEntryComp.java b/app/src/main/java/io/xpipe/app/hub/comp/StoreEntryComp.java index 0e63100f7..7d1b680da 100644 --- a/app/src/main/java/io/xpipe/app/hub/comp/StoreEntryComp.java +++ b/app/src/main/java/io/xpipe/app/hub/comp/StoreEntryComp.java @@ -448,8 +448,8 @@ public abstract class StoreEntryComp extends SimpleComp { if (AppPrefs.get().developerMode().getValue()) { var browse = new MenuItem( AppI18n.get("browseInternalStorage"), new FontIcon("mdi2f-folder-open-outline")); - browse.setOnAction(event -> DesktopHelper.browseFile( - getWrapper().getEntry().getDirectory())); + browse.setOnAction(event -> + DesktopHelper.browseFile(getWrapper().getEntry().getDirectory())); items.add(browse); } diff --git a/app/src/main/java/io/xpipe/app/prefs/AppPrefsComp.java b/app/src/main/java/io/xpipe/app/prefs/AppPrefsComp.java index fbc271a79..9f7f35f9f 100644 --- a/app/src/main/java/io/xpipe/app/prefs/AppPrefsComp.java +++ b/app/src/main/java/io/xpipe/app/prefs/AppPrefsComp.java @@ -10,6 +10,7 @@ import javafx.beans.property.SimpleBooleanProperty; import javafx.geometry.Insets; import javafx.scene.control.ScrollPane; import javafx.scene.layout.*; + import net.synedra.validatorfx.GraphicDecorationStackPane; public class AppPrefsComp extends SimpleComp { diff --git a/app/src/main/java/io/xpipe/app/prefs/HibernateBehaviour.java b/app/src/main/java/io/xpipe/app/prefs/HibernateBehaviour.java index 4f0b6cafa..8e1a234d5 100644 --- a/app/src/main/java/io/xpipe/app/prefs/HibernateBehaviour.java +++ b/app/src/main/java/io/xpipe/app/prefs/HibernateBehaviour.java @@ -5,7 +5,9 @@ import io.xpipe.app.core.mode.AppOperationMode; import io.xpipe.app.ext.PrefsChoiceValue; import io.xpipe.app.storage.DataStorageUserHandler; import io.xpipe.app.util.ThreadHelper; + import javafx.beans.value.ObservableValue; + import lombok.Getter; @Getter diff --git a/app/src/main/java/io/xpipe/app/prefs/VaultCategory.java b/app/src/main/java/io/xpipe/app/prefs/VaultCategory.java index 022064e00..e23affd9b 100644 --- a/app/src/main/java/io/xpipe/app/prefs/VaultCategory.java +++ b/app/src/main/java/io/xpipe/app/prefs/VaultCategory.java @@ -2,12 +2,10 @@ package io.xpipe.app.prefs; import io.xpipe.app.comp.Comp; import io.xpipe.app.comp.base.ButtonComp; -import io.xpipe.app.comp.base.ChoiceComp; import io.xpipe.app.comp.base.ModalButton; import io.xpipe.app.comp.base.ModalOverlay; import io.xpipe.app.core.AppI18n; import io.xpipe.app.core.window.AppDialog; -import io.xpipe.app.ext.PrefsChoiceValue; import io.xpipe.app.platform.LabelGraphic; import io.xpipe.app.platform.OptionsBuilder; import io.xpipe.app.storage.DataStorageSyncHandler; @@ -87,9 +85,7 @@ public class VaultCategory extends AppPrefsCategory { .disable(!LicenseProvider.get().getFeature("team").isSupported()) .hide(new SimpleBooleanProperty( DataStorageSyncHandler.getInstance().supportsSync()))); - builder.sub(new OptionsBuilder() - .pref(prefs.encryptAllVaultData) - .addToggle(encryptVault)); + builder.sub(new OptionsBuilder().pref(prefs.encryptAllVaultData).addToggle(encryptVault)); return builder.buildComp(); } } diff --git a/app/src/main/java/io/xpipe/app/process/ProcessOutputException.java b/app/src/main/java/io/xpipe/app/process/ProcessOutputException.java index e3a1c6a96..dbb63554d 100644 --- a/app/src/main/java/io/xpipe/app/process/ProcessOutputException.java +++ b/app/src/main/java/io/xpipe/app/process/ProcessOutputException.java @@ -14,7 +14,8 @@ public class ProcessOutputException extends Exception { private final String prefix; private final String suffix; - private ProcessOutputException(String command, long exitCode, String output, String prefix, String suffix, Exception cause) { + private ProcessOutputException( + String command, long exitCode, String output, String prefix, String suffix, Exception cause) { super(cause); this.exitCode = exitCode; this.output = output; @@ -58,10 +59,10 @@ public class ProcessOutputException extends Exception { var message = switch ((int) exitCode) { case CommandControl.START_FAILED_EXIT_CODE -> - start + "did not start up properly and had to be killed"; + start + "did not start up properly and had to be killed"; case CommandControl.EXIT_TIMEOUT_EXIT_CODE -> "Wait for exit of " + center + "timed out"; case CommandControl.UNASSIGNED_EXIT_CODE -> - start + "exited with unknown state. Did an external process interfere?"; + start + "exited with unknown state. Did an external process interfere?"; case CommandControl.INTERNAL_ERROR_EXIT_CODE -> start + "execution failed"; case CommandControl.ELEVATION_FAILED_EXIT_CODE -> start + "elevation failed"; default -> start + "failed with exit code " + exitCode; diff --git a/app/src/main/java/io/xpipe/app/pwman/KeePassXcProxyClient.java b/app/src/main/java/io/xpipe/app/pwman/KeePassXcProxyClient.java index e57be31ff..dfbaaf55c 100644 --- a/app/src/main/java/io/xpipe/app/pwman/KeePassXcProxyClient.java +++ b/app/src/main/java/io/xpipe/app/pwman/KeePassXcProxyClient.java @@ -120,7 +120,8 @@ public class KeePassXcProxyClient { sendNativeMessage(keyExchangeMessage); } catch (IOException e) { var ex = new IllegalStateException( - "KeePassXC client did not respond. Is the browser integration enabled for your KeePassXC database?", e); + "KeePassXC client did not respond. Is the browser integration enabled for your KeePassXC database?", + e); ErrorEventFactory.preconfigure( ErrorEventFactory.fromThrowable(ex).expected().documentationLink(DocumentationLink.KEEPASSXC)); throw ex; diff --git a/app/src/main/java/io/xpipe/app/storage/DataStorage.java b/app/src/main/java/io/xpipe/app/storage/DataStorage.java index 7d39902dd..d1882b18c 100644 --- a/app/src/main/java/io/xpipe/app/storage/DataStorage.java +++ b/app/src/main/java/io/xpipe/app/storage/DataStorage.java @@ -286,7 +286,7 @@ public abstract class DataStorage { && getStoreEntries().stream().noneMatch(e -> { var hierarchy = getCategoryParentHierarchy(getStoreCategory(e)); return hierarchy.stream().anyMatch(h -> h.getUuid().equals(SYNCED_IDENTITIES_CATEGORY_UUID)); - })) { + })) { return false; } diff --git a/app/src/main/java/io/xpipe/app/terminal/WarpTerminalType.java b/app/src/main/java/io/xpipe/app/terminal/WarpTerminalType.java index fd15ce6e5..82dd782d8 100644 --- a/app/src/main/java/io/xpipe/app/terminal/WarpTerminalType.java +++ b/app/src/main/java/io/xpipe/app/terminal/WarpTerminalType.java @@ -4,7 +4,6 @@ import io.xpipe.app.core.AppSystemInfo; import io.xpipe.app.prefs.ExternalApplicationType; import io.xpipe.app.process.*; import io.xpipe.app.util.*; -import io.xpipe.core.FilePath; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; @@ -89,7 +88,8 @@ public interface WarpTerminalType extends ExternalTerminalType, TrackableTermina // Move to subdir as Warp tries to index the parent dir, which would be temp in this case var scriptFile = ScriptHelper.createExecScript(configuration.getScriptDialect(), sc, command); - var movedScriptFile = AppSystemInfo.ofCurrent().getTemp().resolve("warp").resolve(scriptFile.getFileName()); + var movedScriptFile = + AppSystemInfo.ofCurrent().getTemp().resolve("warp").resolve(scriptFile.getFileName()); Files.createDirectories(movedScriptFile.getParent()); Files.move(scriptFile.asLocalPath(), movedScriptFile); diff --git a/app/src/main/java/io/xpipe/app/update/AppDistributionType.java b/app/src/main/java/io/xpipe/app/update/AppDistributionType.java index e7a850940..d55611237 100644 --- a/app/src/main/java/io/xpipe/app/update/AppDistributionType.java +++ b/app/src/main/java/io/xpipe/app/update/AppDistributionType.java @@ -165,14 +165,19 @@ public enum AppDistributionType implements Translatable { return SCOOP; } - if (OsType.ofLocal() == OsType.LINUX && System.getenv("APPDIR") != null && System.getenv("APPIMAGE") != null) { + if (OsType.ofLocal() == OsType.LINUX + && System.getenv("APPDIR") != null + && System.getenv("APPIMAGE") != null) { try { var dir = Path.of(System.getenv("APPDIR")); - if (AppInstallation.ofCurrent().getBaseInstallationPath().startsWith(dir)) { + if (AppInstallation.ofCurrent() + .getBaseInstallationPath() + .startsWith(dir)) { return APP_IMAGE; } - } catch (InvalidPathException ignored) {} + } catch (InvalidPathException ignored) { + } } return PORTABLE; diff --git a/app/src/main/java/io/xpipe/app/util/DesktopHelper.java b/app/src/main/java/io/xpipe/app/util/DesktopHelper.java index cc7c209c9..191a95125 100644 --- a/app/src/main/java/io/xpipe/app/util/DesktopHelper.java +++ b/app/src/main/java/io/xpipe/app/util/DesktopHelper.java @@ -3,15 +3,12 @@ package io.xpipe.app.util; import io.xpipe.app.ext.FileKind; import io.xpipe.app.issue.ErrorEventFactory; import io.xpipe.app.process.CommandBuilder; -import io.xpipe.app.process.LocalShell; import io.xpipe.app.process.ShellControl; -import io.xpipe.app.update.AppDistributionType; import io.xpipe.core.FilePath; import io.xpipe.core.OsType; import java.awt.*; import java.net.URI; -import java.net.URLEncoder; import java.nio.file.Files; import java.nio.file.Path; import java.util.List; @@ -55,7 +52,10 @@ public class DesktopHelper { return; } catch (Exception e) { // Some basic linux systems have trouble with the API call - ErrorEventFactory.fromThrowable(e).expected().omitted(OsType.ofLocal() == OsType.LINUX).handle(); + ErrorEventFactory.fromThrowable(e) + .expected() + .omitted(OsType.ofLocal() == OsType.LINUX) + .handle(); } } @@ -89,11 +89,18 @@ public class DesktopHelper { ? "org.freedesktop.FileManager1.ShowFolders" : "org.freedesktop.FileManager1.ShowItems"; var args = List.of( - "dbus-send", "--session", "--print-reply", "--dest=org.freedesktop.FileManager1", "--type=method_call", - "/org/freedesktop/FileManager1", action, "array:string:file://" + file, "string:" - ); + "dbus-send", + "--session", + "--print-reply", + "--dest=org.freedesktop.FileManager1", + "--type=method_call", + "/org/freedesktop/FileManager1", + action, + "array:string:file://" + file, + "string:"); try { - var success = LocalExec.readStdoutIfPossible(args.toArray(String[]::new)).isPresent(); + var success = LocalExec.readStdoutIfPossible(args.toArray(String[]::new)) + .isPresent(); if (success) { return; } @@ -111,7 +118,10 @@ public class DesktopHelper { Desktop.getDesktop().browseFileDirectory(file.toFile()); } catch (Exception e) { // Some basic linux systems have trouble with the API call - ErrorEventFactory.fromThrowable(e).expected().omitted(OsType.ofLocal() == OsType.LINUX).handle(); + ErrorEventFactory.fromThrowable(e) + .expected() + .omitted(OsType.ofLocal() == OsType.LINUX) + .handle(); if (OsType.ofLocal() == OsType.LINUX) { browseFile(file.getParent()); } diff --git a/app/src/main/java/io/xpipe/app/util/RemminaHelper.java b/app/src/main/java/io/xpipe/app/util/RemminaHelper.java index 4eca379bb..7234bc4d2 100644 --- a/app/src/main/java/io/xpipe/app/util/RemminaHelper.java +++ b/app/src/main/java/io/xpipe/app/util/RemminaHelper.java @@ -8,7 +8,6 @@ import io.xpipe.app.rdp.RdpLaunchConfig; import io.xpipe.app.vnc.VncLaunchConfig; import io.xpipe.core.SecretValue; -import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; import java.util.Arrays; diff --git a/ext/base/src/main/java/io/xpipe/ext/base/host/HostAddressSwitchBranchProvider.java b/ext/base/src/main/java/io/xpipe/ext/base/host/HostAddressSwitchBranchProvider.java index 2e91bdb3e..8c68a7daa 100644 --- a/ext/base/src/main/java/io/xpipe/ext/base/host/HostAddressSwitchBranchProvider.java +++ b/ext/base/src/main/java/io/xpipe/ext/base/host/HostAddressSwitchBranchProvider.java @@ -34,7 +34,8 @@ public class HostAddressSwitchBranchProvider implements HubBranchProvider o) { - return o.getStore().getHostAddress() != null && !o.getStore().getHostAddress().isSingle(); + return o.getStore().getHostAddress() != null + && !o.getStore().getHostAddress().isSingle(); } @Override diff --git a/ext/base/src/main/java/io/xpipe/ext/base/identity/ssh/InPlaceKeyStrategy.java b/ext/base/src/main/java/io/xpipe/ext/base/identity/ssh/InPlaceKeyStrategy.java index 3dc0b8d7f..824a8754d 100644 --- a/ext/base/src/main/java/io/xpipe/ext/base/identity/ssh/InPlaceKeyStrategy.java +++ b/ext/base/src/main/java/io/xpipe/ext/base/identity/ssh/InPlaceKeyStrategy.java @@ -1,35 +1,29 @@ package io.xpipe.ext.base.identity.ssh; -import com.fasterxml.jackson.annotation.JsonTypeName; import io.xpipe.app.comp.base.TextAreaComp; import io.xpipe.app.core.AppSystemInfo; import io.xpipe.app.ext.ValidationException; -import io.xpipe.app.issue.ErrorEventFactory; import io.xpipe.app.platform.OptionsBuilder; import io.xpipe.app.platform.OptionsChoiceBuilder; import io.xpipe.app.process.CommandBuilder; import io.xpipe.app.process.ShellControl; import io.xpipe.app.secret.SecretRetrievalStrategy; import io.xpipe.app.secret.SecretStrategyChoiceConfig; -import io.xpipe.app.storage.ContextualFileReference; -import io.xpipe.app.storage.DataStorage; import io.xpipe.app.util.LocalFileTracker; import io.xpipe.app.util.Validators; import io.xpipe.core.*; + import javafx.beans.property.Property; -import javafx.beans.property.ReadOnlyObjectWrapper; import javafx.beans.property.SimpleObjectProperty; import javafx.beans.property.SimpleStringProperty; + +import com.fasterxml.jackson.annotation.JsonTypeName; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Value; import lombok.extern.jackson.Jacksonized; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.HashSet; import java.util.List; -import java.util.Set; @Value @Jacksonized @@ -40,7 +34,8 @@ public class InPlaceKeyStrategy implements SshIdentityStrategy { @SuppressWarnings("unused") public static OptionsBuilder createOptions(Property p, SshIdentityStrategyChoiceConfig config) { - var key = new SimpleStringProperty(p.getValue().getKey() != null ? p.getValue().getKey().getSecretValue() : null); + var key = new SimpleStringProperty( + p.getValue().getKey() != null ? p.getValue().getKey().getSecretValue() : null); var keyPasswordProperty = new SimpleObjectProperty<>(p.getValue() != null ? p.getValue().getPassword() : null); @@ -55,13 +50,17 @@ public class InPlaceKeyStrategy implements SshIdentityStrategy { return new OptionsBuilder() .nameAndDescription("inPlaceKeyText") - .addComp(new TextAreaComp(key).apply(struc -> { - struc.getTextArea().setPromptText(""" + .addComp( + new TextAreaComp(key).apply(struc -> { + struc.getTextArea() + .setPromptText( + """ -----BEGIN ... PRIVATE KEY----- - + -----END ... PRIVATE KEY----- """); - }), key) + }), + key) .nonNull() .name("keyPassword") .description("sshConfigHost.identityPassphraseDescription") @@ -69,7 +68,9 @@ public class InPlaceKeyStrategy implements SshIdentityStrategy { .nonNull() .bind( () -> { - return new InPlaceKeyStrategy(key.get() != null ? InPlaceSecretValue.of(key.get()) : null, keyPasswordProperty.get()); + return new InPlaceKeyStrategy( + key.get() != null ? InPlaceSecretValue.of(key.get()) : null, + keyPasswordProperty.get()); }, p); } diff --git a/ext/base/src/main/java/io/xpipe/ext/base/identity/ssh/SshIdentityStrategy.java b/ext/base/src/main/java/io/xpipe/ext/base/identity/ssh/SshIdentityStrategy.java index 1784067a3..e5690162c 100644 --- a/ext/base/src/main/java/io/xpipe/ext/base/identity/ssh/SshIdentityStrategy.java +++ b/ext/base/src/main/java/io/xpipe/ext/base/identity/ssh/SshIdentityStrategy.java @@ -9,7 +9,6 @@ import io.xpipe.app.process.ShellControl; import io.xpipe.app.secret.SecretNoneStrategy; import io.xpipe.app.secret.SecretRetrievalStrategy; import io.xpipe.core.FilePath; -import io.xpipe.core.InPlaceSecretValue; import io.xpipe.core.KeyValue; import io.xpipe.core.OsType;