commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject [2/2] commons-compress git commit: entry names of directories should end with slashes
Date Mon, 23 Apr 2018 14:29:42 GMT
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 <bodewig@apache.org>
Authored: Mon Apr 23 16:26:38 2018 +0200
Committer: Stefan Bodewig <bodewig@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);
             }
         }
     }


Mime
View raw message