Skip to content

Commit 881618e

Browse files
committed
Fix overriding gethHome() instead of getHome()
1 parent a200d0d commit 881618e

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

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

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,22 @@ public HubCryptoVault(final Path home, final String decryptedPayload, final Stri
4343
this.decryptedPayload = decryptedPayload;
4444
}
4545

46+
public Path encrypt(Session<?> session, Path file, byte[] directoryId, boolean metadata) throws BackgroundException {
47+
log.debug("HubCryptoVault.encrypt. Use directory ID '{}' for folder {}", directoryId, file);
48+
// assert directoryId != null;
49+
return super.encrypt(session, file, directoryId, metadata);
50+
}
51+
4652

4753
@Override
48-
public Path getHome() {
54+
public Path gethHome() {
4955
// TODO how to avoid doing this every time?
50-
final Path home = super.getHome();
56+
final Path home = super.gethHome();
5157
final UVFMasterkey masterKey = UVFMasterkey.fromDecryptedPayload(this.decryptedPayload);
52-
PathAttributes pathAttributes = new PathAttributes();
53-
pathAttributes.setDirectoryId(masterKey.rootDirId());
58+
final PathAttributes pathAttributes = new PathAttributes();
59+
byte[] directoryId = masterKey.rootDirId();
60+
assert directoryId != null;
61+
pathAttributes.setDirectoryId(directoryId);
5462
return home.withAttributes(pathAttributes);
5563
}
5664

0 commit comments

Comments
 (0)