Skip to content

Commit

Permalink
Merge branch 'release/3.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
infeo committed May 8, 2023
2 parents ef216c2 + 5f63894 commit 84adbeb
Show file tree
Hide file tree
Showing 12 changed files with 59 additions and 53 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-central.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-github.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions .idea/modules.xml

This file was deleted.

4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/).
27 changes: 11 additions & 16 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.cryptomator</groupId>
<artifactId>fuse-nio-adapter</artifactId>
<version>2.0.5</version>
<version>3.0.0</version>
<name>FUSE-NIO-Adapter</name>
<description>Access resources at a given NIO path via FUSE.</description>
<url>https://github.com/cryptomator/fuse-nio-adapter</url>
Expand All @@ -17,23 +17,24 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.build.jdk>19</project.build.jdk>
<project.build.jdk>20</project.build.jdk>

<!-- dependencies -->
<integrations-api.version>1.2.0</integrations-api.version>
<jfuse.version>0.4.2</jfuse.version>
<jfuse.version>0.5.1</jfuse.version>
<guava.version>31.1-jre</guava.version>
<slf4j.version>2.0.3</slf4j.version>
<caffeine.version>3.1.4</caffeine.version>
<slf4j.version>2.0.7</slf4j.version>
<caffeine.version>3.1.6</caffeine.version>

<!-- test dependencies -->
<junit.jupiter.version>5.9.0</junit.jupiter.version>
<mockito.version>4.7.0</mockito.version>
<cryptofs.version>2.4.3</cryptofs.version>
<junit.jupiter.version>5.9.3</junit.jupiter.version>
<mockito.version>5.3.1</mockito.version>
<cryptofs.version>2.6.4</cryptofs.version>

<!-- build dependencies -->
<dependency-check.version>8.1.2</dependency-check.version>
<dependency-check.version>8.2.1</dependency-check.version>
<maven.deploy.version>3.1.0</maven.deploy.version>
<jacoco.version>0.8.9</jacoco.version>
</properties>

<licenses>
Expand Down Expand Up @@ -137,12 +138,6 @@
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-inline</artifactId>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.cryptomator</groupId>
<artifactId>cryptofs</artifactId>
Expand Down Expand Up @@ -175,7 +170,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.8</version>
<version>${jacoco.version}</version>
<executions>
<execution>
<id>prepare-agent</id>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
Expand Down Expand Up @@ -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();
}
}
Expand All @@ -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();
}
}
Expand All @@ -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();
}
}
Expand Down
24 changes: 13 additions & 11 deletions src/main/java/org/cryptomator/frontend/fuse/ReadWriteAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
Expand Down Expand Up @@ -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();
}
}
Expand All @@ -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();
}
}
Expand All @@ -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();
}
}
Expand Down Expand Up @@ -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();
}
}
Expand Down Expand Up @@ -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();
}
}
Expand All @@ -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();
}
}
Expand All @@ -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();
}
}
Expand All @@ -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();
}
}
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/org/cryptomator/frontend/fuse/WindowsUtil.java
Original file line number Diff line number Diff line change
@@ -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() {}


}
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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());
Expand All @@ -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());
Expand Down

0 comments on commit 84adbeb

Please sign in to comment.