diff options
-rw-r--r-- | src/main/java/com/keuin/kbackupfabric/util/ZipUtil.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main/java/com/keuin/kbackupfabric/util/ZipUtil.java b/src/main/java/com/keuin/kbackupfabric/util/ZipUtil.java index c23527f..eea1148 100644 --- a/src/main/java/com/keuin/kbackupfabric/util/ZipUtil.java +++ b/src/main/java/com/keuin/kbackupfabric/util/ZipUtil.java @@ -127,8 +127,9 @@ public final class ZipUtil { ObjectOutputStream oos = new ObjectOutputStream(baos)) { oos.writeObject(backupMetadata); zipOutputStream.write(baos.toByteArray()); + } finally { + zipOutputStream.closeEntry(); } - zipOutputStream.closeEntry(); //如果只是压缩一个文件,则需要截取该文件的父目录 String srcRootDir = srcPath; |