Skip to content

Commit

Permalink
Do not try to delete the encrypted root folder as long as we are unab…
Browse files Browse the repository at this point in the history
…le to delete the entire vault. Otherwise the listing of the vault fails.
  • Loading branch information
ylangisc committed May 16, 2017
1 parent 3086ae8 commit 6d2c619
Showing 1 changed file with 11 additions and 9 deletions.
Expand Up @@ -44,15 +44,17 @@ public CryptoDeleteFeature(final Session<?> session, final Delete proxy, final C
public void delete(final List<Path> files, final LoginCallback prompt, final Callback callback) throws BackgroundException {
final List<Path> encrypted = new ArrayList<>();
for(Path f : files) {
final Path encrypt = vault.encrypt(session, f);
encrypted.add(encrypt);
if(f.isDirectory()) {
// Delete metadata file for directory
encrypted.add(vault.encrypt(session, f, true));
}
if(filenameProvider.isDeflated(encrypt.getName())) {
final Path metadataFile = filenameProvider.resolve(encrypt.getName());
encrypted.add(metadataFile);
if(!f.equals(vault.getHome())) {
final Path encrypt = vault.encrypt(session, f);
encrypted.add(encrypt);
if(f.isDirectory()) {
// Delete metadata file for directory
encrypted.add(vault.encrypt(session, f, true));
}
if(filenameProvider.isDeflated(encrypt.getName())) {
final Path metadataFile = filenameProvider.resolve(encrypt.getName());
encrypted.add(metadataFile);
}
}
}
proxy.delete(encrypted, prompt, callback);
Expand Down

0 comments on commit 6d2c619

Please sign in to comment.