diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cf8004f..ca9e1df 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-java@v3 with: - java-version: 19 + java-version: 20 distribution: 'zulu' cache: 'maven' - name: Ensure to use tagged version diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 0342aac..893923f 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -20,7 +20,7 @@ jobs: fetch-depth: 2 - uses: actions/setup-java@v3 with: - java-version: 19 + java-version: 20 distribution: 'zulu' cache: 'maven' - name: Initialize CodeQL diff --git a/.github/workflows/publish-central.yml b/.github/workflows/publish-central.yml index 9ad01e7..5587f7b 100644 --- a/.github/workflows/publish-central.yml +++ b/.github/workflows/publish-central.yml @@ -15,7 +15,7 @@ jobs: ref: "refs/tags/${{ github.event.inputs.tag }}" - uses: actions/setup-java@v3 with: - java-version: 19 + java-version: 20 distribution: 'zulu' cache: 'maven' server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml diff --git a/.github/workflows/publish-github.yml b/.github/workflows/publish-github.yml index b233f6c..bdcc2f6 100644 --- a/.github/workflows/publish-github.yml +++ b/.github/workflows/publish-github.yml @@ -10,7 +10,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-java@v3 with: - java-version: 19 + java-version: 20 distribution: 'zulu' cache: 'maven' gpg-private-key: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }} # Value of the GPG private key to import diff --git a/.idea/misc.xml b/.idea/misc.xml index b385302..bf3f4bb 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -7,5 +7,5 @@ - + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index c612358..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/README.md b/README.md index eb93eb4..395b4e4 100644 --- a/README.md +++ b/README.md @@ -8,10 +8,6 @@ Provides directory contents specified by a `java.nio.file.Path` via a FUSE files Uses [jfuse](https://github.com/cryptomator/jfuse), i.e. you need to install the specified fuse drivers for your OS. -## Configuration Parameters -The following system properties are used: -* `org.cryptomator.frontend.fuse.mountTimeOut` - The mount timeout threshold in milliseonds. If the mounting operation exceeds it, the mounting is aborted. - ## License This project is dual-licensed under the AGPLv3 for FOSS projects as well as a commercial license for independent software vendors and resellers. If you want to use this library in applications, that are *not* licensed under the AGPL, feel free to contact our [support team](https://cryptomator.org/help/). diff --git a/pom.xml b/pom.xml index 35043ed..745b155 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 org.cryptomator fuse-nio-adapter - 2.0.5 + 3.0.0 FUSE-NIO-Adapter Access resources at a given NIO path via FUSE. https://github.com/cryptomator/fuse-nio-adapter @@ -17,23 +17,24 @@ UTF-8 - 19 + 20 1.2.0 - 0.4.2 + 0.5.1 31.1-jre - 2.0.3 - 3.1.4 + 2.0.7 + 3.1.6 - 5.9.0 - 4.7.0 - 2.4.3 + 5.9.3 + 5.3.1 + 2.6.4 - 8.1.2 + 8.2.1 3.1.0 + 0.8.9 @@ -137,12 +138,6 @@ ${mockito.version} test - - org.mockito - mockito-inline - ${mockito.version} - test - org.cryptomator cryptofs @@ -175,7 +170,7 @@ org.jacoco jacoco-maven-plugin - 0.8.8 + ${jacoco.version} prepare-agent diff --git a/src/main/java/org/cryptomator/frontend/fuse/ReadOnlyAdapter.java b/src/main/java/org/cryptomator/frontend/fuse/ReadOnlyAdapter.java index 3dc7b52..ad9713e 100644 --- a/src/main/java/org/cryptomator/frontend/fuse/ReadOnlyAdapter.java +++ b/src/main/java/org/cryptomator/frontend/fuse/ReadOnlyAdapter.java @@ -123,7 +123,7 @@ public int statfs(String path, Statvfs stbuf) { LOG.trace("statfs {} ({} / {})", path, avail, total); return 0; } catch (IOException | RuntimeException e) { - LOG.error("statfs " + path + " failed.", e); + LOG.error("statfs {} failed.", path, e); return -errno.eio(); } } @@ -250,7 +250,7 @@ public int open(String path, FileInfo fi) { LOG.warn("Attempted to open file with unsupported flags.", e); return -errno.erofs(); } catch (IOException | RuntimeException e) { - LOG.error("open " + path + " failed.", e); + LOG.error("open {} failed.", path, e); return -errno.eio(); } } @@ -267,7 +267,7 @@ public int read(String path, ByteBuffer buf, long size, long offset, FileInfo fi LOG.warn("read {} failed, invalid file handle {}", path, fi.getFh()); return -errno.ebadf(); } catch (IOException | RuntimeException e) { - LOG.error("read " + path + " failed.", e); + LOG.error("read {} failed.", path, e); return -errno.eio(); } } @@ -283,7 +283,7 @@ public int release(String path, FileInfo fi) { LOG.warn("release {} failed, invalid file handle {}", path, fi.getFh()); return -errno.ebadf(); } catch (IOException | RuntimeException e) { - LOG.error("release " + path + " failed.", e); + LOG.error("release {} failed.", path, e); return -errno.eio(); } } diff --git a/src/main/java/org/cryptomator/frontend/fuse/ReadWriteAdapter.java b/src/main/java/org/cryptomator/frontend/fuse/ReadWriteAdapter.java index 98cc96a..810c312 100644 --- a/src/main/java/org/cryptomator/frontend/fuse/ReadWriteAdapter.java +++ b/src/main/java/org/cryptomator/frontend/fuse/ReadWriteAdapter.java @@ -92,7 +92,7 @@ public int mkdir(String path, int mode) { } catch (FileSystemException e) { return getErrorCodeForGenericFileSystemException(e, "mkdir " + path); } catch (IOException | RuntimeException e) { - LOG.error("mkdir " + path + " failed.", e); + LOG.error("mkdir {} failed.", path, e); return -errno.eio(); } } @@ -137,7 +137,7 @@ public int create(String path, int mode, FileInfo fi) { } catch (FileSystemException e) { return getErrorCodeForGenericFileSystemException(e, "create " + path); } catch (IOException | RuntimeException e) { - LOG.error("create " + path + " failed.", e); + LOG.error("create {} failed.", path, e); return -errno.eio(); } } @@ -160,10 +160,12 @@ public int chmod(String path, int mode, FileInfo fi) { LOG.warn("chmod {} failed, file not found.", path); return -errno.enoent(); } catch (UnsupportedOperationException e) { - LOG.warn("Setting posix permissions not supported by underlying file system."); + if (!WindowsUtil.IS_RUNNING_OS) { //prevent spamming warnings + LOG.warn("Setting posix permissions not supported by underlying file system."); + } return -errno.enosys(); } catch (IOException | RuntimeException e) { - LOG.error("chmod " + path + " failed.", e); + LOG.error("chmod {} failed.", path, e); return -errno.eio(); } } @@ -184,7 +186,7 @@ public int unlink(String path) { LOG.warn("unlink {} failed, file not found.", path); return -errno.enoent(); } catch (IOException | RuntimeException e) { - LOG.error("unlink " + path + " failed.", e); + LOG.error("unlink {} failed.", path, e); return -errno.eio(); } } @@ -212,7 +214,7 @@ public int rmdir(String path) { LOG.warn("rmdir {} failed, directory not empty.", path); return -errno.enotempty(); } catch (IOException | RuntimeException e) { - LOG.error("rmdir " + path + " failed.", e); + LOG.error("rmdir {} failed.", path, e); return -errno.eio(); } } @@ -270,7 +272,7 @@ public int utimens(String path, TimeSpec atime, TimeSpec mtime, FileInfo fi) { LOG.warn("utimens {} failed, file not found.", path); return -errno.enoent(); } catch (IOException | RuntimeException e) { - LOG.error("utimens " + path + " failed.", e); + LOG.error("utimens {} failed.", path, e); return -errno.eio(); } } @@ -287,7 +289,7 @@ public int write(String path, ByteBuffer buf, long size, long offset, FileInfo f LOG.warn("write {} failed, invalid file handle {}", path, fi.getFh()); return -errno.ebadf(); } catch (IOException | RuntimeException e) { - LOG.error("write " + path + " failed.", e); + LOG.error("write {} failed.", path, e); return -errno.eio(); } } @@ -305,10 +307,10 @@ public int truncate(String path, long size, FileInfo fi) { } return 0; } catch (NoSuchFileException e) { - LOG.warn("utimens {} failed, file not found.", path); + LOG.warn("truncate {} failed, file not found.", path); return -errno.enoent(); } catch (IOException | RuntimeException e) { - LOG.error("truncate " + path + " failed.", e); + LOG.error("truncate {} failed.", path, e); return -errno.eio(); } } @@ -324,7 +326,7 @@ public int fsync(String path, int isdatasync, FileInfo fi) { LOG.warn("fsync {} failed, invalid file handle {}", path, fi.getFh()); return -errno.ebadf(); } catch (IOException | RuntimeException e) { - LOG.error("fsync " + path + " failed.", e); + LOG.error("fsync {} failed.", path, e); return -errno.eio(); } } diff --git a/src/main/java/org/cryptomator/frontend/fuse/WindowsUtil.java b/src/main/java/org/cryptomator/frontend/fuse/WindowsUtil.java new file mode 100644 index 0000000..d5705a1 --- /dev/null +++ b/src/main/java/org/cryptomator/frontend/fuse/WindowsUtil.java @@ -0,0 +1,10 @@ +package org.cryptomator.frontend.fuse; + +public class WindowsUtil { + + public static final boolean IS_RUNNING_OS = System.getProperty("os.name").toLowerCase().contains("windows"); + + private WindowsUtil() {} + + +} diff --git a/src/test/java/org/cryptomator/frontend/fuse/mount/MirroringFuseMountTest.java b/src/test/java/org/cryptomator/frontend/fuse/mount/MirroringFuseMountTest.java index 5311b65..a593106 100644 --- a/src/test/java/org/cryptomator/frontend/fuse/mount/MirroringFuseMountTest.java +++ b/src/test/java/org/cryptomator/frontend/fuse/mount/MirroringFuseMountTest.java @@ -28,11 +28,6 @@ */ public class MirroringFuseMountTest { - static { - System.setProperty("org.slf4j.simpleLogger.defaultLogLevel", "debug"); - System.setProperty("org.slf4j.simpleLogger.showDateTime", "true"); - System.setProperty("org.slf4j.simpleLogger.dateTimeFormat", "HH:mm:ss.SSS"); - } private static final Logger LOG = LoggerFactory.getLogger(MirroringFuseMountTest.class); @@ -41,6 +36,14 @@ public class MirroringFuseMountTest { */ public static class Mirror { + static { + System.setProperty("org.slf4j.simpleLogger.defaultLogLevel", "debug"); + System.setProperty("org.slf4j.simpleLogger.log.org.cryptomator.frontend.fuse.locks.DataLock", "warn"); + System.setProperty("org.slf4j.simpleLogger.log.org.cryptomator.frontend.fuse.locks.PathLock", "warn"); + System.setProperty("org.slf4j.simpleLogger.showDateTime", "true"); + System.setProperty("org.slf4j.simpleLogger.dateTimeFormat", "HH:mm:ss.SSS"); + } + public static void main(String[] args) throws MountFailedException { var mountService = MountService.get().findAny().orElseThrow(() -> new MountFailedException("Did not find a mount provider")); LOG.info("Using mount provider: {}", mountService.displayName()); @@ -58,6 +61,14 @@ public static void main(String[] args) throws MountFailedException { */ public static class CryptoFsMirror { + static { + System.setProperty("org.slf4j.simpleLogger.defaultLogLevel", "debug"); + System.setProperty("org.slf4j.simpleLogger.log.org.cryptomator.frontend.fuse.locks.DataLock", "warn"); + System.setProperty("org.slf4j.simpleLogger.log.org.cryptomator.frontend.fuse.locks.PathLock", "warn"); + System.setProperty("org.slf4j.simpleLogger.showDateTime", "true"); + System.setProperty("org.slf4j.simpleLogger.dateTimeFormat", "HH:mm:ss.SSS"); + } + public static void main(String[] args) throws IOException, NoSuchAlgorithmException, MountFailedException { var mountService = MountService.get().findAny().orElseThrow(() -> new MountFailedException("Did not find a mount provider")); LOG.info("Using mount provider: {}", mountService.displayName());