You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by bo...@apache.org on 2018/04/23 14:29:41 UTC

[1/2] commons-compress git commit: channel-arg version shouldn't close the channel, owned by caller

Repository: commons-compress
Updated Branches:
  refs/heads/master f45ba62db -> 9c3c448cf


channel-arg version shouldn't close the channel, owned by caller


Project: http://git-wip-us.apache.org/repos/asf/commons-compress/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-compress/commit/69d5b2f0
Tree: http://git-wip-us.apache.org/repos/asf/commons-compress/tree/69d5b2f0
Diff: http://git-wip-us.apache.org/repos/asf/commons-compress/diff/69d5b2f0

Branch: refs/heads/master
Commit: 69d5b2f0b54c1478e4122466b3ae298eff53ec31
Parents: f45ba62
Author: Stefan Bodewig <bo...@apache.org>
Authored: Mon Apr 23 16:23:18 2018 +0200
Committer: Stefan Bodewig <bo...@apache.org>
Committed: Mon Apr 23 16:23:18 2018 +0200

----------------------------------------------------------------------
 .../java/org/apache/commons/compress/archivers/Archiver.java     | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-compress/blob/69d5b2f0/src/main/java/org/apache/commons/compress/archivers/Archiver.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/compress/archivers/Archiver.java b/src/main/java/org/apache/commons/compress/archivers/Archiver.java
index fa3c6a1..f580f5f 100644
--- a/src/main/java/org/apache/commons/compress/archivers/Archiver.java
+++ b/src/main/java/org/apache/commons/compress/archivers/Archiver.java
@@ -158,9 +158,7 @@ public class Archiver {
     public void create(String format, SeekableByteChannel target, File directory, FileFilter filter)
         throws IOException, ArchiveException {
         if (!prefersSeekableByteChannel(format)) {
-            try (OutputStream o = Channels.newOutputStream(target)) {
-                create(format, o, directory, filter);
-            }
+            create(format, Channels.newOutputStream(target), directory, filter);
         } else if (ArchiveStreamFactory.ZIP.equalsIgnoreCase(format)) {
             create(format, new ZipArchiveOutputStream(target), directory, filter);
         } else if (ArchiveStreamFactory.SEVEN_Z.equalsIgnoreCase(format)) {


[2/2] commons-compress git commit: entry names of directories should end with slashes

Posted by bo...@apache.org.
entry names of directories should end with slashes


Project: http://git-wip-us.apache.org/repos/asf/commons-compress/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-compress/commit/9c3c448c
Tree: http://git-wip-us.apache.org/repos/asf/commons-compress/tree/9c3c448c
Diff: http://git-wip-us.apache.org/repos/asf/commons-compress/diff/9c3c448c

Branch: refs/heads/master
Commit: 9c3c448cf2561131d7b573e94eadfb4afa581231
Parents: 69d5b2f
Author: Stefan Bodewig <bo...@apache.org>
Authored: Mon Apr 23 16:26:38 2018 +0200
Committer: Stefan Bodewig <bo...@apache.org>
Committed: Mon Apr 23 16:26:38 2018 +0200

----------------------------------------------------------------------
 .../java/org/apache/commons/compress/archivers/Archiver.java    | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-compress/blob/9c3c448c/src/main/java/org/apache/commons/compress/archivers/Archiver.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/compress/archivers/Archiver.java b/src/main/java/org/apache/commons/compress/archivers/Archiver.java
index f580f5f..c576fc0 100644
--- a/src/main/java/org/apache/commons/compress/archivers/Archiver.java
+++ b/src/main/java/org/apache/commons/compress/archivers/Archiver.java
@@ -258,9 +258,10 @@ public class Archiver {
             return;
         }
         for (File f : children) {
-            consumer.accept(f, creator.create(f, prefix + f.getName()));
+            String entryName = prefix + f.getName() + (f.isDirectory() ? "/" : "");
+            consumer.accept(f, creator.create(f, entryName));
             if (f.isDirectory()) {
-                create(prefix + f.getName() + "/", f, filter, creator, consumer);
+                create(entryName, f, filter, creator, consumer);
             }
         }
     }