From f748b4904866a9e627b1051031eaa37f9bef2a61 Mon Sep 17 00:00:00 2001 From: felmer <felmer> Date: Tue, 3 Feb 2015 14:52:14 +0000 Subject: [PATCH] Bug fix in Tar: closeArchiveEntry() put into a finally clause because it should be called in any case. SVN: 33377 --- .../ch/systemsx/cisd/common/filesystem/tar/Tar.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/common/source/java/ch/systemsx/cisd/common/filesystem/tar/Tar.java b/common/source/java/ch/systemsx/cisd/common/filesystem/tar/Tar.java index 82f5f4f26bb..6383dfd4d3d 100644 --- a/common/source/java/ch/systemsx/cisd/common/filesystem/tar/Tar.java +++ b/common/source/java/ch/systemsx/cisd/common/filesystem/tar/Tar.java @@ -157,11 +157,16 @@ public class Tar implements Closeable entry.setGroupName(groupname); } out.putArchiveEntry(entry); - if (input != null) + try { - IOUtils.copyLarge(input, out); + if (input != null) + { + IOUtils.copyLarge(input, out); + } + } finally + { + out.closeArchiveEntry(); } - out.closeArchiveEntry(); } @Override -- GitLab