Skip to content

Commit 2d5e7d3

Browse files
fixes #74
1 parent 59ffd96 commit 2d5e7d3

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/main/java/org/cryptomator/cryptofs/attr/CryptoBasicFileAttributes.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ public CryptoBasicFileAttributes(BasicFileAttributes delegate, CiphertextFileTyp
3939
this.ciphertextFileType = ciphertextFileType;
4040
switch (ciphertextFileType) {
4141
case SYMLINK:
42-
this.size = -1;
43-
break;
4442
case DIRECTORY:
4543
this.size = delegate.size();
4644
break;

src/test/java/org/cryptomator/cryptofs/attr/CryptoBasicFileAttributesTest.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,13 @@ public void testSizeOfDirectory() {
8686
Assertions.assertEquals(4096l, attr.size());
8787
}
8888

89+
@Test
90+
public void testSizeOfSymlink() {
91+
Mockito.when(delegateAttr.size()).thenReturn(123l);
92+
BasicFileAttributes attr = new CryptoBasicFileAttributes(delegateAttr, SYMLINK, ciphertextFilePath, cryptor, Optional.empty());
93+
Assertions.assertEquals(123l, attr.size());
94+
}
95+
8996
@Test
9097
public void testSizeSetToZeroIfCryptoHeaderToSmall() {
9198
Mockito.when(delegateAttr.size()).thenReturn(88l + 20l);

0 commit comments

Comments
 (0)