From e9b3b505a84d84d5a251b38f098776bc1f046acb Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Wed, 28 Jan 2026 17:35:34 +0100 Subject: [PATCH] apply suggestions from code review --- dist/common/cryptomator.config | 2 +- .../java/org/cryptomator/launcher/AdminPropertiesSetter.java | 5 ++--- .../org/cryptomator/launcher/AdminPropertiesSetterTest.java | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/dist/common/cryptomator.config b/dist/common/cryptomator.config index c0ab0f54f..98c5f753f 100644 --- a/dist/common/cryptomator.config +++ b/dist/common/cryptomator.config @@ -1,7 +1,7 @@ # This is the Cryptomator administrative configuration file. # It is a simple key-value pair file. # Lines starting with '#' are comments and will be ignored. -# For more info, read the docs at https://docs.cryptomator.org. +# For more info, read the docs at https://docs.cryptomator.org/desktop/advanced-settings/ # # Example: # Sets the plugin directory and enables plugin loading diff --git a/src/main/java/org/cryptomator/launcher/AdminPropertiesSetter.java b/src/main/java/org/cryptomator/launcher/AdminPropertiesSetter.java index c32687226..26de38f10 100644 --- a/src/main/java/org/cryptomator/launcher/AdminPropertiesSetter.java +++ b/src/main/java/org/cryptomator/launcher/AdminPropertiesSetter.java @@ -38,7 +38,6 @@ class AdminPropertiesSetter { private static final Logger LOG = EventualLogger.getInstance(); private static final long MAX_CONFIG_SIZE_BYTES = 8192; - private static final String LINUX_DIR = "/etc/cryptomator"; private static final String MAC_DIR = "/Library/Application Support/Cryptomator"; private static final String WIN_DIR = "C:\\ProgramData\\Cryptomator"; @@ -50,6 +49,7 @@ class AdminPropertiesSetter { "cryptomator.mountPointsDir", // "cryptomator.disableUpdateCheck"); + private static final Path ADMIN_PROPERTIES_FILE; static { final Path adminDir; @@ -63,7 +63,6 @@ class AdminPropertiesSetter { ADMIN_PROPERTIES_FILE = adminDir.resolve(CONFIG_NAME); } - private static final Path ADMIN_PROPERTIES_FILE; /** * Adjusts the system properties by loading administrative properties from a predefined file location. @@ -101,7 +100,7 @@ class AdminPropertiesSetter { } } catch (NoSuchFileException _) { //NO-OP - LOG.debug("No admin properties found at {}.", adminPropertiesPath); + LOG.debug("No admin properties found at {}.", adminPropertiesPath); } catch (IOException | IllegalArgumentException e) { LOG.warn("Failed to read administrative properties from {}. Returning empty properties.", adminPropertiesPath, e); } diff --git a/src/test/java/org/cryptomator/launcher/AdminPropertiesSetterTest.java b/src/test/java/org/cryptomator/launcher/AdminPropertiesSetterTest.java index 9e8b4962b..f33bd4d80 100644 --- a/src/test/java/org/cryptomator/launcher/AdminPropertiesSetterTest.java +++ b/src/test/java/org/cryptomator/launcher/AdminPropertiesSetterTest.java @@ -50,7 +50,7 @@ public class AdminPropertiesSetterTest { @Test @DisplayName("Loading invalid file returns empty properties") - void loadEmptyFile(@TempDir Path path) throws IOException { + void loadInvalidFile(@TempDir Path path) throws IOException { var config = path.resolve("config.properties"); try (var out = Files.newOutputStream(config, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING, StandardOpenOption.WRITE)) { var bytes = "method=\\u2u20".getBytes(StandardCharsets.UTF_8); //only one "u" is allowed in a Unicode escape sequence