Skip to content

Commit

Permalink
Merge branch 'release/0.3.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
overheadhunter committed Oct 28, 2022
2 parents ca438bd + c5d51ef commit 16c7b9b
Show file tree
Hide file tree
Showing 25 changed files with 58 additions and 58 deletions.
2 changes: 1 addition & 1 deletion .idea/runConfigurations/WindowsMirrorFileSystem.xml

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

2 changes: 1 addition & 1 deletion jfuse-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.cryptomator</groupId>
<artifactId>jfuse-parent</artifactId>
<version>0.3.1</version>
<version>0.3.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>jfuse-api</artifactId>
Expand Down
10 changes: 5 additions & 5 deletions jfuse-api/src/main/java/org/cryptomator/jfuse/api/Fuse.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,12 @@ public static FuseBuilder builder() {
* @param progName The program name used to construct a usage message and to derive a fallback for <code>-ofsname=...</code>
* @param mountPoint mount point
* @param flags Additional flags. Use flag <code>-help</code> to get a list of available flags
* @throws MountFailedException If mounting failed
* @throws FuseMountFailedException If mounting failed
* @throws IllegalArgumentException If providing unsupported mount flags
*/
@Blocking
@MustBeInvokedByOverriders
public void mount(String progName, Path mountPoint, String... flags) throws MountFailedException, IllegalArgumentException {
public void mount(String progName, Path mountPoint, String... flags) throws FuseMountFailedException, IllegalArgumentException {
FuseMount lock = new UnmountedFuseMount();
if (!mount.compareAndSet(UNMOUNTED, lock)) {
throw new IllegalStateException("Already mounted");
Expand All @@ -124,7 +124,7 @@ public void mount(String progName, Path mountPoint, String... flags) throws Moun
mount.compareAndSet(lock, fuseMount);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new MountFailedException("Interrupted while waiting for mounting to finish");
throw new FuseMountFailedException("Interrupted while waiting for mounting to finish");
} finally {
mount.compareAndSet(lock, UNMOUNTED); // if value is still `lock`, mount has failed.
}
Expand Down Expand Up @@ -156,11 +156,11 @@ private int fuseLoop(FuseMount mount) {
*
* @param args Mount args
* @return A mount object
* @throws MountFailedException Thrown if mounting failed
* @throws FuseMountFailedException Thrown if mounting failed
* @throws IllegalArgumentException Thrown if parsing {@code args} failed
*/
@Blocking
protected abstract FuseMount mount(List<String> args) throws MountFailedException, IllegalArgumentException;
protected abstract FuseMount mount(List<String> args) throws FuseMountFailedException, IllegalArgumentException;

/**
* Unmounts (if needed) this fuse file system and frees up system resources.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
/**
* Thrown when {@link Fuse#mount(String, Path, String...) mounting} failed.
*/
public class MountFailedException extends Exception {
public class FuseMountFailedException extends Exception {

/**
* Constructs a new exception with the specified detail message.
*
* @param message the detail message
*/
public MountFailedException(String message) {
public FuseMountFailedException(String message) {
super(message);
}

Expand Down
2 changes: 1 addition & 1 deletion jfuse-examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.cryptomator</groupId>
<artifactId>jfuse-parent</artifactId>
<version>0.3.1</version>
<version>0.3.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>jfuse-examples</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import org.cryptomator.jfuse.api.FuseConfig;
import org.cryptomator.jfuse.api.FuseConnInfo;
import org.cryptomator.jfuse.api.FuseOperations;
import org.cryptomator.jfuse.api.MountFailedException;
import org.cryptomator.jfuse.api.FuseMountFailedException;
import org.cryptomator.jfuse.api.Stat;
import org.cryptomator.jfuse.api.Statvfs;
import org.slf4j.Logger;
Expand Down Expand Up @@ -45,7 +45,7 @@ public static void main(String[] args) {
LOG.info("Mounted to {}.", mountPoint);
LOG.info("Enter a anything to unmount...");
System.in.read();
} catch (MountFailedException | TimeoutException e) {
} catch (FuseMountFailedException | TimeoutException e) {
LOG.error("Un/Mounting failed. ", e);
System.exit(1);
} catch (IOException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import org.cryptomator.jfuse.api.FileInfo;
import org.cryptomator.jfuse.api.FileModes;
import org.cryptomator.jfuse.api.Fuse;
import org.cryptomator.jfuse.api.MountFailedException;
import org.cryptomator.jfuse.api.FuseMountFailedException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -41,7 +41,7 @@ public static void main(String[] args) {
LOG.info("Mounted to {}.", mountPoint);
LOG.info("Enter a anything to unmount...");
System.in.read();
} catch (MountFailedException | TimeoutException e) {
} catch (FuseMountFailedException | TimeoutException e) {
LOG.error("Un/Mounting failed. ", e);
System.exit(1);
} catch (IOException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import org.cryptomator.jfuse.api.FileInfo;
import org.cryptomator.jfuse.api.Fuse;
import org.cryptomator.jfuse.api.FuseOperations;
import org.cryptomator.jfuse.api.MountFailedException;
import org.cryptomator.jfuse.api.FuseMountFailedException;
import org.cryptomator.jfuse.api.Stat;
import org.cryptomator.jfuse.api.Statvfs;
import org.slf4j.Logger;
Expand Down Expand Up @@ -42,7 +42,7 @@ public static void main(String[] args) {
LOG.info("Mounted to {}.", mountPoint);
LOG.info("Enter a anything to unmount...");
System.in.read();
} catch (MountFailedException | TimeoutException e) {
} catch (FuseMountFailedException | TimeoutException e) {
LOG.error("Un/Mounting failed. ", e);
System.exit(1);
} catch (IOException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import org.cryptomator.jfuse.api.Errno;
import org.cryptomator.jfuse.api.Fuse;
import org.cryptomator.jfuse.api.MountFailedException;
import org.cryptomator.jfuse.api.FuseMountFailedException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -35,7 +35,7 @@ public static void main(String[] args) {
LOG.info("Mounted to {}.", mountPoint);
LOG.info("Enter a anything to unmount...");
System.in.read();
} catch (MountFailedException | TimeoutException e) {
} catch (FuseMountFailedException | TimeoutException e) {
LOG.error("Un/Mounting failed. ", e);
System.exit(1);
} catch (IOException e) {
Expand Down
2 changes: 1 addition & 1 deletion jfuse-linux-aarch64/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>jfuse-parent</artifactId>
<groupId>org.cryptomator</groupId>
<version>0.3.1</version>
<version>0.3.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>jfuse-linux-aarch64</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import org.cryptomator.jfuse.api.FuseConnInfo;
import org.cryptomator.jfuse.api.FuseMount;
import org.cryptomator.jfuse.api.FuseOperations;
import org.cryptomator.jfuse.api.MountFailedException;
import org.cryptomator.jfuse.api.FuseMountFailedException;
import org.cryptomator.jfuse.linux.aarch64.extr.fuse_args;
import org.cryptomator.jfuse.linux.aarch64.extr.fuse_cmdline_opts;
import org.cryptomator.jfuse.linux.aarch64.extr.fuse_h;
Expand All @@ -28,14 +28,14 @@ public FuseImpl(FuseOperations fuseOperations) {
}

@Override
protected FuseMount mount(List<String> args) throws MountFailedException {
protected FuseMount mount(List<String> args) throws FuseMountFailedException {
var fuseArgs = parseArgs(args);
var fuse = fuse_h.fuse_new(fuseArgs.args(), fuseOperationsStruct, fuseOperationsStruct.byteSize(), MemoryAddress.NULL);
if (MemoryAddress.NULL.equals(fuse)) {
throw new MountFailedException("fuse_new failed");
throw new FuseMountFailedException("fuse_new failed");
}
if (fuse_h.fuse_mount(fuse, fuseArgs.mountPoint()) != 0) {
throw new MountFailedException("fuse_mount failed");
throw new FuseMountFailedException("fuse_mount failed");
}
return new FuseMountImpl(fuse, fuseArgs);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import org.cryptomator.jfuse.api.FuseConnInfo;
import org.cryptomator.jfuse.api.FuseOperations;
import org.cryptomator.jfuse.api.MountFailedException;
import org.cryptomator.jfuse.api.FuseMountFailedException;
import org.cryptomator.jfuse.api.TimeSpec;
import org.cryptomator.jfuse.linux.aarch64.extr.fuse_cmdline_opts;
import org.cryptomator.jfuse.linux.aarch64.extr.fuse_config;
Expand Down Expand Up @@ -59,7 +59,7 @@ public void teardown() {
public void testFuseNewFails() {
fuseH.when(() -> fuse_h.fuse_new(Mockito.any(), Mockito.any(), Mockito.anyLong(), Mockito.any())).thenReturn(MemoryAddress.NULL);

var thrown = Assertions.assertThrows(MountFailedException.class, () -> fuseImplSpy.mount(args));
var thrown = Assertions.assertThrows(FuseMountFailedException.class, () -> fuseImplSpy.mount(args));

fuseH.verify(() -> fuse_h.fuse_mount(Mockito.any(), Mockito.any()), Mockito.never());
Assertions.assertEquals("fuse_new failed", thrown.getMessage());
Expand All @@ -71,7 +71,7 @@ public void testFuseMountFails() {
fuseH.when(() -> fuse_h.fuse_new(Mockito.any(), Mockito.any(), Mockito.anyLong(), Mockito.any())).thenReturn(MemoryAddress.ofLong(42L));
fuseH.when(() -> fuse_h.fuse_mount(Mockito.any(), Mockito.any())).thenReturn(1);

var thrown = Assertions.assertThrows(MountFailedException.class, () -> fuseImplSpy.mount(args));
var thrown = Assertions.assertThrows(FuseMountFailedException.class, () -> fuseImplSpy.mount(args));

Assertions.assertEquals("fuse_mount failed", thrown.getMessage());
}
Expand Down
2 changes: 1 addition & 1 deletion jfuse-linux-amd64/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.cryptomator</groupId>
<artifactId>jfuse-parent</artifactId>
<version>0.3.1</version>
<version>0.3.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>jfuse-linux-amd64</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import org.cryptomator.jfuse.api.FuseConnInfo;
import org.cryptomator.jfuse.api.FuseMount;
import org.cryptomator.jfuse.api.FuseOperations;
import org.cryptomator.jfuse.api.MountFailedException;
import org.cryptomator.jfuse.api.FuseMountFailedException;
import org.cryptomator.jfuse.linux.amd64.extr.fuse_args;
import org.cryptomator.jfuse.linux.amd64.extr.fuse_cmdline_opts;
import org.cryptomator.jfuse.linux.amd64.extr.fuse_h;
Expand All @@ -28,14 +28,14 @@ public FuseImpl(FuseOperations fuseOperations) {
}

@Override
protected FuseMount mount(List<String> args) throws MountFailedException {
protected FuseMount mount(List<String> args) throws FuseMountFailedException {
var fuseArgs = parseArgs(args);
var fuse = fuse_h.fuse_new(fuseArgs.args(), fuseOperationsStruct, fuseOperationsStruct.byteSize(), MemoryAddress.NULL);
if (MemoryAddress.NULL.equals(fuse)) {
throw new MountFailedException("fuse_new failed");
throw new FuseMountFailedException("fuse_new failed");
}
if (fuse_h.fuse_mount(fuse, fuseArgs.mountPoint()) != 0) {
throw new MountFailedException("fuse_mount failed");
throw new FuseMountFailedException("fuse_mount failed");
}
return new FuseMountImpl(fuse, fuseArgs);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import org.cryptomator.jfuse.api.FuseConnInfo;
import org.cryptomator.jfuse.api.FuseOperations;
import org.cryptomator.jfuse.api.MountFailedException;
import org.cryptomator.jfuse.api.FuseMountFailedException;
import org.cryptomator.jfuse.api.TimeSpec;
import org.cryptomator.jfuse.linux.amd64.extr.fuse_cmdline_opts;
import org.cryptomator.jfuse.linux.amd64.extr.fuse_config;
Expand Down Expand Up @@ -59,7 +59,7 @@ public void teardown() {
public void testFuseNewFails() {
fuseH.when(() -> fuse_h.fuse_new(Mockito.any(), Mockito.any(), Mockito.anyLong(), Mockito.any())).thenReturn(MemoryAddress.NULL);

var thrown = Assertions.assertThrows(MountFailedException.class, () -> fuseImplSpy.mount(args));
var thrown = Assertions.assertThrows(FuseMountFailedException.class, () -> fuseImplSpy.mount(args));

fuseH.verify(() -> fuse_h.fuse_mount(Mockito.any(), Mockito.any()), Mockito.never());
Assertions.assertEquals("fuse_new failed", thrown.getMessage());
Expand All @@ -71,7 +71,7 @@ public void testFuseMountFails() {
fuseH.when(() -> fuse_h.fuse_new(Mockito.any(), Mockito.any(), Mockito.anyLong(), Mockito.any())).thenReturn(MemoryAddress.ofLong(42L));
fuseH.when(() -> fuse_h.fuse_mount(Mockito.any(), Mockito.any())).thenReturn(1);

var thrown = Assertions.assertThrows(MountFailedException.class, () -> fuseImplSpy.mount(args));
var thrown = Assertions.assertThrows(FuseMountFailedException.class, () -> fuseImplSpy.mount(args));

Assertions.assertEquals("fuse_mount failed", thrown.getMessage());
}
Expand Down
2 changes: 1 addition & 1 deletion jfuse-mac/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.cryptomator</groupId>
<artifactId>jfuse-parent</artifactId>
<version>0.3.1</version>
<version>0.3.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>jfuse-mac</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import org.cryptomator.jfuse.api.Fuse;
import org.cryptomator.jfuse.api.FuseMount;
import org.cryptomator.jfuse.api.FuseOperations;
import org.cryptomator.jfuse.api.MountFailedException;
import org.cryptomator.jfuse.api.FuseMountFailedException;
import org.cryptomator.jfuse.mac.extr.fuse_args;
import org.cryptomator.jfuse.mac.extr.fuse_h;
import org.cryptomator.jfuse.mac.extr.fuse_operations;
Expand All @@ -28,16 +28,16 @@ public FuseImpl(FuseOperations fuseOperations) {
}

@Override
protected FuseMount mount(List<String> args) throws MountFailedException {
protected FuseMount mount(List<String> args) throws FuseMountFailedException {
var fuseArgs = parseArgs(args);
var ch = fuse_h.fuse_mount(fuseArgs.mountPoint(), fuseArgs.args());
if (MemoryAddress.NULL.equals(ch)) {
throw new MountFailedException("fuse_mount failed");
throw new FuseMountFailedException("fuse_mount failed");
}
var fuse = fuse_h.fuse_new(ch, fuseArgs.args(), fuseOperationsStruct, fuseOperationsStruct.byteSize(), MemoryAddress.NULL);
if (MemoryAddress.NULL.equals(fuse)) {
fuse_h.fuse_unmount(fuseArgs.mountPoint(), ch);
throw new MountFailedException("fuse_new failed");
throw new FuseMountFailedException("fuse_new failed");
}
return new FuseMountImpl(fuse, ch, fuseArgs);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.cryptomator.jfuse.mac;

import org.cryptomator.jfuse.api.FuseOperations;
import org.cryptomator.jfuse.api.MountFailedException;
import org.cryptomator.jfuse.api.FuseMountFailedException;
import org.cryptomator.jfuse.api.TimeSpec;
import org.cryptomator.jfuse.mac.extr.fuse_file_info;
import org.cryptomator.jfuse.mac.extr.fuse_h;
Expand Down Expand Up @@ -57,7 +57,7 @@ public void testFuseNewFails() {
fuseH.when(() -> fuse_h.fuse_mount(Mockito.any(), Mockito.any())).thenReturn(MemoryAddress.ofLong(42L));
fuseH.when(() -> fuse_h.fuse_new(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.anyLong(), Mockito.any())).thenReturn(MemoryAddress.NULL);

var thrown = Assertions.assertThrows(MountFailedException.class, () -> fuseImplSpy.mount(args));
var thrown = Assertions.assertThrows(FuseMountFailedException.class, () -> fuseImplSpy.mount(args));

fuseH.verify(() -> fuse_h.fuse_unmount(Mockito.any(), Mockito.any()));
Assertions.assertEquals("fuse_new failed", thrown.getMessage());
Expand All @@ -68,7 +68,7 @@ public void testFuseNewFails() {
public void testFuseMountFails() {
fuseH.when(() -> fuse_h.fuse_mount(Mockito.any(), Mockito.any())).thenReturn(MemoryAddress.NULL);

var thrown = Assertions.assertThrows(MountFailedException.class, () -> fuseImplSpy.mount(args));
var thrown = Assertions.assertThrows(FuseMountFailedException.class, () -> fuseImplSpy.mount(args));

fuseH.verify(() -> fuse_h.fuse_new(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.anyLong(), Mockito.any()), Mockito.never());
Assertions.assertEquals("fuse_mount failed", thrown.getMessage());
Expand Down
2 changes: 1 addition & 1 deletion jfuse-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.cryptomator</groupId>
<artifactId>jfuse-parent</artifactId>
<version>0.3.1</version>
<version>0.3.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>jfuse-tests</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import org.cryptomator.jfuse.api.Fuse;
import org.cryptomator.jfuse.api.FuseBuilder;
import org.cryptomator.jfuse.api.MountFailedException;
import org.cryptomator.jfuse.api.FuseMountFailedException;
import org.cryptomator.jfuse.examples.AbstractMirrorFileSystem;
import org.cryptomator.jfuse.examples.PosixMirrorFileSystem;
import org.cryptomator.jfuse.examples.WindowsMirrorFileSystem;
Expand Down Expand Up @@ -57,7 +57,7 @@ static boolean hasSupportedImplementation() {
private Fuse fuse;

@BeforeAll
public void setup(@TempDir Path tmpDir) throws IOException, MountFailedException {
public void setup(@TempDir Path tmpDir) throws IOException, FuseMountFailedException {
var builder = Fuse.builder();
var libPath = System.getProperty("fuse.lib.path");
if (libPath != null && !libPath.isEmpty()) {
Expand All @@ -78,7 +78,7 @@ public void setup(@TempDir Path tmpDir) throws IOException, MountFailedExceptio
Files.createDirectories(mirror);
yield new PosixMirrorFileSystem(orig, builder.errno());
}
default -> throw new MountFailedException("Unsupported OS");
default -> throw new FuseMountFailedException("Unsupported OS");
};
fuse = builder.build(fs);
fuse.mount("mirror-it", mirror, flags.toArray(String[]::new));
Expand Down
2 changes: 1 addition & 1 deletion jfuse-win/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.cryptomator</groupId>
<artifactId>jfuse-parent</artifactId>
<version>0.3.1</version>
<version>0.3.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>jfuse-win</artifactId>
Expand Down
Loading

0 comments on commit 16c7b9b

Please sign in to comment.