diff --git a/pom.xml b/pom.xml index 2fa7fcdd..47dd52e5 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 org.cryptomator cryptofs - 2.6.0 + 2.6.1 Cryptomator Crypto Filesystem This library provides the Java filesystem provider used by Cryptomator. https://github.com/cryptomator/cryptofs diff --git a/src/main/java/org/cryptomator/cryptofs/CryptoFileSystemImpl.java b/src/main/java/org/cryptomator/cryptofs/CryptoFileSystemImpl.java index 35cb3359..887bb189 100644 --- a/src/main/java/org/cryptomator/cryptofs/CryptoFileSystemImpl.java +++ b/src/main/java/org/cryptomator/cryptofs/CryptoFileSystemImpl.java @@ -140,10 +140,11 @@ public Path getPathToVault() { public Path getCiphertextPath(Path cleartextPath) throws IOException { var p = CryptoPath.castAndAssertAbsolute(cleartextPath); var nodeType = cryptoPathMapper.getCiphertextFileType(p); - var cipherFile = cryptoPathMapper.getCiphertextFilePath(p); if( nodeType == CiphertextFileType.DIRECTORY) { return cryptoPathMapper.getCiphertextDir(p).path; - } else if( nodeType == CiphertextFileType.SYMLINK) { + } + var cipherFile = cryptoPathMapper.getCiphertextFilePath(p); + if( nodeType == CiphertextFileType.SYMLINK) { return cipherFile.getSymlinkFilePath(); } else { return cipherFile.getFilePath(); diff --git a/src/test/java/org/cryptomator/cryptofs/CryptoFileSystemImplTest.java b/src/test/java/org/cryptomator/cryptofs/CryptoFileSystemImplTest.java index 9a8cc039..a133999f 100644 --- a/src/test/java/org/cryptomator/cryptofs/CryptoFileSystemImplTest.java +++ b/src/test/java/org/cryptomator/cryptofs/CryptoFileSystemImplTest.java @@ -74,6 +74,7 @@ import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.doThrow; import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verifyNoInteractions; import static org.mockito.Mockito.verifyNoMoreInteractions; @@ -204,6 +205,7 @@ public void testCleartextDirectory() throws IOException { Path result = inTest.getCiphertextPath(cleartext); Assertions.assertEquals(ciphertext, result); + Mockito.verify(cryptoPathMapper,never()).getCiphertextFilePath(any()); } }