Make delegating folders create their parents during own creation if they don't exist yet.

This commit is contained in:
Sebastian Stenzel
2016-01-09 01:22:27 +01:00
parent 415423abd7
commit 0c42392244
2 changed files with 5 additions and 1 deletions

View File

@@ -63,6 +63,10 @@ public abstract class DelegatingFolder<R extends DelegatingReadableFile, W exten
@Override
public void create() throws UncheckedIOException {
if (exists()) {
return;
}
parent().ifPresent(p -> p.create());
delegate.create();
}

View File

@@ -85,7 +85,7 @@ public class CryptoFileSystem extends CryptoFolder implements FileSystem {
@Override
public boolean exists() {
return physicalRoot.exists();
return physicalFile().exists() && physicalFolder().exists();
}
@Override