commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r1159027 - in /commons/proper/compress/trunk/src: main/java/org/apache/commons/compress/archivers/dump/DumpArchiveEntry.java test/java/org/apache/commons/compress/archivers/DumpTestCase.java
Date Thu, 18 Aug 2011 04:27:07 GMT
Author: bodewig
Date: Thu Aug 18 04:27:07 2011
New Revision: 1159027

URL: http://svn.apache.org/viewvc?rev=1159027&view=rev
Log:
I don't think leading slashes is what one would expect from the content of a dump archive.
 COMPRESS-132

Modified:
    commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveEntry.java
    commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/DumpTestCase.java

Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveEntry.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveEntry.java?rev=1159027&r1=1159026&r2=1159027&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveEntry.java
(original)
+++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveEntry.java
Thu Aug 18 04:27:07 2011
@@ -575,12 +575,12 @@ public class DumpArchiveEntry implements
     public final void setName(String name) {
         this.originalName = name;
         if (name != null) {
-            if (".".equals(name) || name.startsWith("./")) {
-                name = name.substring(1);
-            }
             if (isDirectory() && !name.endsWith("/")) {
                 name += "/";
             }
+            if (name.startsWith("./")) {
+                name = name.substring(2);
+            }
         }
         this.name = name;
     }

Modified: commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/DumpTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/DumpTestCase.java?rev=1159027&r1=1159026&r2=1159027&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/DumpTestCase.java
(original)
+++ commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/DumpTestCase.java
Thu Aug 18 04:27:07 2011
@@ -104,10 +104,10 @@ public final class DumpTestCase extends 
 
     private void checkDumpArchive(final File f) throws Exception {
         ArrayList<String> expected = new ArrayList<String>();
-        expected.add("/");
-        expected.add("/lost+found/");
-        expected.add("/test1.xml");
-        expected.add("/test2.xml");
+        expected.add("");
+        expected.add("lost+found/");
+        expected.add("test1.xml");
+        expected.add("test2.xml");
         final InputStream is = new FileInputStream(f);
         try {
             checkArchiveContent(new DumpArchiveInputStream(is),



Mime
View raw message