This repository was archived by the owner on Mar 14, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed
src/main/java/org/cryptomator/cloudaccess Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change 99import org .cryptomator .cloudaccess .api .ProgressListener ;
1010import org .cryptomator .cloudaccess .api .Quota ;
1111import org .cryptomator .cloudaccess .api .exceptions .NotFoundException ;
12+ import org .cryptomator .cloudaccess .api .exceptions .QuotaNotAvailableException ;
1213
1314import java .io .InputStream ;
1415import 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 );
Original file line number Diff line number Diff 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 ));
You can’t perform that action at this time.
0 commit comments