fixed writing short ciphertext to file, that existed with a longer ciphertext before but wasn't truncated

This commit is contained in:
Sebastian Stenzel
2016-02-22 19:07:02 +01:00
parent 1467c8315c
commit 5b22806bbc
3 changed files with 11 additions and 10 deletions
@@ -73,6 +73,7 @@ class DavFolder extends DavNode<FolderLocator> {
private void addMemberFile(DavFile memberFile, InputStream inputStream) {
try (ReadableByteChannel src = Channels.newChannel(inputStream); WritableFile dst = node.file(memberFile.getDisplayName()).openWritable()) {
dst.truncate();
ByteStreams.copy(src, dst);
} catch (IOException e) {
throw new UncheckedIOException(e);