Skip to content

Commit bcd6f64

Browse files
Add UVF middleware with directory path resolution
* Replace the crypto middleware placeholder with the UVF middleware module * Implement UvfFileSystem as a decorator that turns cleartext paths into ciphertext * Add VaultConfig/VaultConfigDecryptor for reading vault metadata * Add a LoggingVfsFileSystem decorator for debugging
1 parent fbc8b62 commit bcd6f64

26 files changed

Lines changed: 1061 additions & 46 deletions

File tree

‎.gitignore‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,10 @@
77

88
# Maven #
99
target/
10-
pom.xml.versionsBackup
10+
pom.xml.versionsBackup
11+
12+
# Eclipse #
13+
.classpath
14+
.project
15+
.settings/
16+
bin/

‎.idea/compiler.xml‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎.idea/encodings.xml‎

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎.idea/jarRepositories.xml‎

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎pom.xml‎

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,36 @@
7878
<module>vfs-backend-nio</module>
7979
<module>vfs-frontend-fuse</module>
8080
<module>vfs-frontend-webdav</module>
81-
<module>vfs-middleware-crypto</module>
81+
<module>vfs-middleware-uvf</module>
8282
<module>vfs-test</module>
8383
</modules>
8484

85+
<repositories>
86+
<repository>
87+
<name>Central Portal Snapshots</name>
88+
<id>central-portal-snapshots</id>
89+
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
90+
<releases>
91+
<enabled>false</enabled>
92+
</releases>
93+
<snapshots>
94+
<enabled>true</enabled>
95+
</snapshots>
96+
</repository>
97+
</repositories>
98+
8599
<dependencies>
86100
<dependency>
87101
<groupId>org.jspecify</groupId>
88102
<artifactId>jspecify</artifactId>
89103
</dependency>
104+
105+
<dependency>
106+
<groupId>org.slf4j</groupId>
107+
<artifactId>slf4j-simple</artifactId>
108+
<version>${slf4j.version}</version>
109+
<scope>test</scope>
110+
</dependency>
90111
<dependency>
91112
<groupId>org.junit.jupiter</groupId>
92113
<artifactId>junit-jupiter</artifactId>

‎vfs-api/src/main/java/org/cryptomator/vfs/api/VfsNodeMetadata.java‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import java.nio.file.attribute.PosixFilePermission;
44
import java.time.Instant;
5-
import java.util.Objects;
65
import java.util.Set;
76

87
/**
@@ -18,10 +17,6 @@ public record VfsNodeMetadata(
1817
) {
1918

2019
public VfsNodeMetadata {
21-
type = Objects.requireNonNull(type);
22-
permissions = Set.copyOf(Objects.requireNonNull(permissions));
23-
lastModifiedTime = Objects.requireNonNull(lastModifiedTime);
24-
lastAccessTime = Objects.requireNonNull(lastAccessTime);
25-
creationTime = Objects.requireNonNull(creationTime);
20+
permissions = Set.copyOf(permissions);
2621
}
2722
}

‎vfs-backend-nio/src/main/java/org/cryptomator/vfs/backend/nio/NioVfsFileSystem.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public List<VfsDirectoryEntry> listDirectory(String path) throws IOException {
9393

9494
@Override
9595
public void createDirectory(String path, Set<PosixFilePermission> permissions) throws IOException {
96-
Files.createDirectory(resolve(path), posixAttributes(permissions));
96+
Files.createDirectories(resolve(path), posixAttributes(permissions));
9797
}
9898

9999
@Override
@@ -151,7 +151,7 @@ private Path resolve(String path) throws IOException {
151151
}
152152

153153
private Set<StandardOpenOption> normalizeOpenOptions(Set<StandardOpenOption> options) {
154-
if (options == null || options.isEmpty()) {
154+
if (options.isEmpty()) {
155155
return EnumSet.of(StandardOpenOption.READ);
156156
}
157157
if (options.size() == 1 && options.contains(StandardOpenOption.APPEND)) {
@@ -161,7 +161,7 @@ private Set<StandardOpenOption> normalizeOpenOptions(Set<StandardOpenOption> opt
161161
}
162162

163163
private FileAttribute<?>[] posixAttributes(Set<PosixFilePermission> permissions) {
164-
if (!posix || permissions == null || permissions.isEmpty()) {
164+
if (!posix || permissions.isEmpty()) {
165165
return new FileAttribute<?>[0];
166166
}
167167
return new FileAttribute<?>[]{PosixFilePermissions.asFileAttribute(permissions)};

‎vfs-middleware-crypto/README.md‎

Lines changed: 0 additions & 3 deletions
This file was deleted.

‎vfs-middleware-crypto/src/main/java/module-info.java‎

Lines changed: 0 additions & 8 deletions
This file was deleted.

‎vfs-middleware-crypto/src/main/java/org/cryptomator/vfs/middleware/crypto/VfsCryptoMiddlewareModule.java‎

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)