Skip to content
This repository was archived by the owner on Mar 14, 2025. It is now read-only.

Commit 8830244

Browse files
committed
Merge branch 'develop' into release/1.1.0
2 parents 19bddb4 + 6796235 commit 8830244

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/main/java/org/cryptomator/cloudaccess/MetadataCachingProviderDecorator.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import org.cryptomator.cloudaccess.api.ProgressListener;
1010
import org.cryptomator.cloudaccess.api.Quota;
1111
import org.cryptomator.cloudaccess.api.exceptions.NotFoundException;
12+
import org.cryptomator.cloudaccess.api.exceptions.QuotaNotAvailableException;
1213

1314
import java.io.InputStream;
1415
import java.time.Duration;
@@ -65,14 +66,14 @@ public CompletionStage<Quota> quota(CloudPath folder) {
6566
if (cachedMetadata != null) {
6667
return cachedMetadata //
6768
.map(CompletableFuture::completedFuture) //
68-
.orElseGet(() -> CompletableFuture.failedFuture(new NotFoundException()));
69+
.orElseGet(() -> CompletableFuture.failedFuture(new QuotaNotAvailableException()));
6970
} else {
7071
return delegate.quota(folder) //
7172
.whenComplete((quota, exception) -> {
7273
if (exception == null) {
7374
assert quota != null;
7475
quotaCache.put(folder, Optional.of(quota));
75-
} else if (exception instanceof NotFoundException) {
76+
} else if (exception instanceof NotFoundException || exception instanceof QuotaNotAvailableException) {
7677
quotaCache.put(folder, Optional.empty());
7778
} else {
7879
quotaCache.invalidate(folder);

src/main/java/org/cryptomator/cloudaccess/vaultformat8/VaultFormat8ProviderDecorator.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,7 @@ public CompletionStage<CloudPath> createFolder(CloudPath folder) {
178178

179179
@Override
180180
public CompletionStage<Void> deleteFile(CloudPath file) {
181-
return itemMetadata(file) //
182-
.thenCompose(cloudNode -> getC9rPath(file)) //
181+
return getC9rPath(file) //
183182
.thenCompose(ciphertextPath -> {
184183
fileHeaderCache.evict(ciphertextPath);
185184
return delegate.deleteFile(ciphertextPath);
@@ -188,8 +187,7 @@ public CompletionStage<Void> deleteFile(CloudPath file) {
188187

189188
@Override
190189
public CompletionStage<Void> deleteFolder(CloudPath folder) {
191-
return itemMetadata(folder) //
192-
.thenCompose(cloudNode -> deleteCiphertextDir(getDirPathFromClearTextDir(folder))) //
190+
return deleteCiphertextDir(getDirPathFromClearTextDir(folder)) //
193191
.thenCompose(ignored -> getC9rPath(folder)) //
194192
.thenCompose(delegate::deleteFolder) //
195193
.thenRun(() -> dirIdCache.evictIncludingDescendants(folder));

0 commit comments

Comments
 (0)