Skip to content

Commit 24822b6

Browse files
Merge branch 'release/0.3.1'
2 parents e8524e1 + 782f486 commit 24822b6

File tree

57 files changed

+2027
-1243
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+2027
-1243
lines changed

.github/workflows/build.yml

+10-6
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
sudo apt-get update
2121
sudo apt-get install fuse3 libfuse3-dev
2222
- name: Maven build
23-
run: mvn -B verify
23+
run: mvn -B verify -Dfuse.lib.path="/lib/x86_64-linux-gnu/libfuse3.so.3"
2424
- uses: actions/upload-artifact@v3
2525
with:
2626
name: coverage-linux-amd64
@@ -29,7 +29,7 @@ jobs:
2929

3030
mac:
3131
name: Test jfuse-mac
32-
runs-on: macos-10.15
32+
runs-on: macos-12
3333
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
3434
steps:
3535
- uses: actions/checkout@v3
@@ -39,9 +39,12 @@ jobs:
3939
distribution: 'zulu'
4040
cache: 'maven'
4141
- name: Setup fuse
42-
run: brew install macfuse
42+
run: |
43+
brew tap macos-fuse-t/homebrew-cask
44+
brew update
45+
brew install fuse-t
4346
- name: Maven build
44-
run: mvn -B verify
47+
run: mvn -B verify -Dfuse.lib.path="/usr/local/lib/libfuse-t.dylib"
4548
- uses: actions/upload-artifact@v3
4649
with:
4750
name: coverage-mac
@@ -60,9 +63,10 @@ jobs:
6063
distribution: 'zulu'
6164
cache: 'maven'
6265
- name: Setup fuse
63-
run: choco install winfsp --version 1.10.22006 -y
66+
run: choco install winfsp --version 1.11.22176 -y
6467
- name: Maven build
65-
run: mvn -B verify
68+
shell: bash # surprise, running maven in pwsh is crappy, see https://stackoverflow.com/q/6347985/4014509
69+
run: mvn -B verify -Dfuse.lib.path="C:\Program Files (x86)\WinFsp\bin\winfsp-x64.dll"
6670
- uses: actions/upload-artifact@v3
6771
with:
6872
name: coverage-win

jfuse-api/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>org.cryptomator</groupId>
77
<artifactId>jfuse-parent</artifactId>
8-
<version>0.3.0</version>
8+
<version>0.3.1</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111
<artifactId>jfuse-api</artifactId>

jfuse-api/src/main/java/org/cryptomator/jfuse/api/Architecture.java

+18
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,29 @@
11
package org.cryptomator.jfuse.api;
22

3+
/**
4+
* CPU architecture
5+
*/
36
public enum Architecture {
7+
/**
8+
* AMD64 aka. x86_64
9+
*/
410
AMD64,
11+
12+
/**
13+
* ARM64 aka. aarch64
14+
*/
515
ARM64,
16+
17+
/**
18+
* Other or unknown architecture
19+
*/
620
UNKNOWN;
721

822
private static final String OS_ARCH = System.getProperty("os.arch").toLowerCase();
23+
24+
/**
25+
* The CPU architecture of the current machine.
26+
*/
927
public static final Architecture CURRENT = getCurrent();
1028

1129
private static Architecture getCurrent() {

jfuse-api/src/main/java/org/cryptomator/jfuse/api/DirFiller.java

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
import java.io.IOException;
44
import java.util.function.Consumer;
55

6+
/**
7+
* The DirFiller will be used during {@link FuseOperations#readdir(String, DirFiller, long, FileInfo, int) readdir} requests
8+
* and needs to be invoked by file system implementations once for every child of the read dir.
9+
*/
610
public interface DirFiller {
711

812
/**

jfuse-api/src/main/java/org/cryptomator/jfuse/api/Errno.java

+36-12
Original file line numberDiff line numberDiff line change
@@ -12,62 +12,86 @@
1212
public interface Errno {
1313

1414
/**
15-
* @return code representing: No such file or directory
15+
* No such file or directory
16+
*
17+
* @return error constant {@code ENOENT}
1618
*/
1719
int enoent();
1820

1921
/**
20-
* @return code representing: Unsupported operation
22+
* Unsupported operation
23+
*
24+
* @return error constant {@code ENOSYS}
2125
*/
2226
int enosys();
2327

2428
/**
25-
* @return code representing: Not enough memory
29+
* Not enough memory
30+
*
31+
* @return error constant {@code ENOMEM}
2632
*/
2733
int enomem();
2834

2935
/**
30-
* @return code representing: Permission denied
36+
* Permission denied
37+
*
38+
* @return error constant {@code EACCES}
3139
*/
3240
int eacces();
3341

3442
/**
35-
* @return code representing: I/O error
43+
* I/O error
44+
*
45+
* @return error constant {@code EIO}
3646
*/
3747
int eio();
3848

3949
/**
40-
* @return code representing: Read only file system
50+
* Read only file system
51+
*
52+
* @return error constant {@code EROFS}
4153
*/
4254
int erofs();
4355

4456
/**
45-
* @return code representing: Bad file number
57+
* Bad file number
58+
*
59+
* @return error constant {@code EBADF}
4660
*/
4761
int ebadf();
4862

4963
/**
50-
* @return code representing: File already exists
64+
* File already exists
65+
*
66+
* @return error constant {@code EEXIST}
5167
*/
5268
int eexist();
5369

5470
/**
55-
* @return code representing: Not a directory
71+
* Not a directory
72+
*
73+
* @return error constant {@code ENOTDIR}
5674
*/
5775
int enotdir();
5876

5977
/**
60-
* @return code representing: Is a directory
78+
* Is a directory
79+
*
80+
* @return error constant {@code EISDIR}
6181
*/
6282
int eisdir();
6383

6484
/**
65-
* @return code representing: Directory not empty
85+
* Directory not empty
86+
*
87+
* @return error constant {@code ENOTEMPTY}
6688
*/
6789
int enotempty();
6890

6991
/**
70-
* @return code representing: Invalid argument
92+
* Invalid argument
93+
*
94+
* @return error constant {@code EINVAL}
7195
*/
7296
int einval();
7397

jfuse-api/src/main/java/org/cryptomator/jfuse/api/FileInfo.java

+26
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,33 @@
33
import java.nio.file.StandardOpenOption;
44
import java.util.Set;
55

6+
/**
7+
* The {@code fi} argument passed to most calls in {@link FuseOperations} when working on an open file.
8+
*/
69
public interface FileInfo {
710

11+
/**
12+
* File handle id. May be filled in by filesystem in {@link FuseOperations#create(String, int, FileInfo) create},
13+
* {@link FuseOperations#open(String, FileInfo) open}, and {@link FuseOperations#opendir(String, FileInfo) opendir()}.
14+
* Available in most other file operations on the same file handle.
15+
*
16+
* @return File handle id
17+
*/
818
long getFh();
919

20+
/**
21+
* Sets the file handle id during {@link FuseOperations#create(String, int, FileInfo) create},
22+
* {@link FuseOperations#open(String, FileInfo) open} or {@link FuseOperations#opendir(String, FileInfo) opendir()}.
23+
*
24+
* @param fh File handle id
25+
*/
1026
void setFh(long fh);
1127

28+
/**
29+
* Open flags. Available in {@link FuseOperations#open(String, FileInfo)} and {@link FuseOperations#release(String, FileInfo)}.
30+
*
31+
* @return Open flags
32+
*/
1233
int getFlags();
1334

1435
/**
@@ -21,6 +42,11 @@ public interface FileInfo {
2142
*/
2243
Set<StandardOpenOption> getOpenFlags();
2344

45+
/**
46+
* Lock owner id. Available in locking operations and flush
47+
*
48+
* @return Lock owner id
49+
*/
2450
long getLockOwner();
2551

2652
}

jfuse-api/src/main/java/org/cryptomator/jfuse/api/FileModes.java

+18
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,26 @@
44
import java.util.EnumSet;
55
import java.util.Set;
66

7+
/**
8+
* Utility for parsing and serializing file permissions to and from octal int representation.
9+
*/
710
@SuppressWarnings("OctalInteger")
811
public final class FileModes {
912

13+
/**
14+
* Mask of the 9 permission bits in a file mode integer
15+
*/
1016
public static final int PERMISSIONS_MASK = 0777;
1117

1218
private FileModes() {
1319
}
1420

21+
/**
22+
* Parses permissions from the 9 least significant bits of the file mode.
23+
*
24+
* @param mode File mode
25+
* @return Parsed permissions
26+
*/
1527
public static Set<PosixFilePermission> toPermissions(int mode) {
1628
Set<PosixFilePermission> permissions = EnumSet.noneOf(PosixFilePermission.class);
1729
// @formatter:off
@@ -28,6 +40,12 @@ public static Set<PosixFilePermission> toPermissions(int mode) {
2840
return permissions;
2941
}
3042

43+
/**
44+
* Serializes the given permissions into a integer.
45+
*
46+
* @param permissions Permissions
47+
* @return An integer with the {@link #PERMISSIONS_MASK permission bits} set accordingly
48+
*/
3149
public static int fromPermissions(Set<PosixFilePermission> permissions) {
3250
int mode = 0;
3351
// @formatter:off

0 commit comments

Comments
 (0)