Skip to content

Commit 216f77e

Browse files
committed
Fix interface.
1 parent 76958e3 commit 216f77e

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

hub/src/main/java/ch/iterate/hub/protocols/hub/HubCryptoVault.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
import ch.cyberduck.core.AbstractPath;
99
import ch.cyberduck.core.DisabledListProgressListener;
1010
import ch.cyberduck.core.ListService;
11-
import ch.cyberduck.core.LoginOptions;
12-
import ch.cyberduck.core.PasswordCallback;
1311
import ch.cyberduck.core.Path;
1412
import ch.cyberduck.core.PathAttributes;
1513
import ch.cyberduck.core.Session;
@@ -23,11 +21,9 @@
2321

2422
import org.apache.logging.log4j.LogManager;
2523
import org.apache.logging.log4j.Logger;
26-
import org.cryptomator.cryptolib.api.Masterkey;
2724
import org.cryptomator.cryptolib.api.UVFMasterkey;
2825

2926
import java.nio.charset.StandardCharsets;
30-
import java.util.Base64;
3127
import java.util.EnumSet;
3228

3329
/**
@@ -44,16 +40,17 @@ public HubCryptoVault(final Path home) {
4440

4541
public HubCryptoVault(final Path home, final String decryptedPayload, final String config, final byte[] pepper) {
4642
super(home, decryptedPayload, config, pepper);
47-
this.decryptedPayload=decryptedPayload;
43+
this.decryptedPayload = decryptedPayload;
4844
}
4945

46+
5047
@Override
5148
public Path getHome() {
52-
// TODO WiP trying to guide AbstractVault.encrypt() -> CryptoDirectoryV7Provider.toEncrypted(final Session<?> session, final String directoryId, final Path directory) -> do we need to write own CryptoDirectory?
49+
// TODO how to avoid doing this every time?
5350
final Path home = super.getHome();
5451
final UVFMasterkey masterKey = UVFMasterkey.fromDecryptedPayload(this.decryptedPayload);
5552
PathAttributes pathAttributes = new PathAttributes();
56-
pathAttributes.setDirectoryId(new String(masterKey.rootDirId()));
53+
pathAttributes.setDirectoryId(masterKey.rootDirId());
5754
return home.withAttributes(pathAttributes);
5855
}
5956

hub/src/test/java/ch/iterate/hub/core/AbstractHubSynchronizeTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,10 +243,10 @@ public void test03AddVault(final HubTestConfig config) throws Exception {
243243
// TODO WiP trying to guide AbstractVault.encrypt() -> CryptoDirectoryV7Provider.toEncrypted(final Session<?> session, final String directoryId, final Path directory) -> do we need to write own CryptoDirectory?
244244
final Path bucket = new Path(vaultBookmark.getDefaultPath(), EnumSet.of(Path.Type.directory, Path.Type.volume, Path.Type.vault));
245245
assertNotSame(Vault.DISABLED, vaultRegistry.find(session, bucket));
246-
// {
247-
// final AttributedList<Path> list = session.getFeature(ListService.class).list(bucket, new DisabledListProgressListener());
248-
// assertTrue(list.isEmpty());
249-
// }
246+
{
247+
final AttributedList<Path> list = session.getFeature(ListService.class).list(bucket, new DisabledListProgressListener());
248+
assertTrue(list.isEmpty());
249+
}
250250

251251
// raw listing encrypted file names
252252
vaultRegistry.close(bucket);

0 commit comments

Comments
 (0)