commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r1603054 - in /commons/proper/compress/trunk/src: main/java/org/apache/commons/compress/compressors/deflate/ test/java/org/apache/commons/compress/compressors/
Date Tue, 17 Jun 2014 04:33:24 GMT
Author: bodewig
Date: Tue Jun 17 04:33:24 2014
New Revision: 1603054

URL: http://svn.apache.org/r1603054
Log:
COMPRESS-263 isZlibHeaderPresent => withZlibHeader

Modified:
    commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/deflate/DeflateCompressorInputStream.java
    commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/deflate/DeflateCompressorOutputStream.java
    commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/deflate/DeflateParameters.java
    commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/compressors/DeflateTestCase.java

Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/deflate/DeflateCompressorInputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/deflate/DeflateCompressorInputStream.java?rev=1603054&r1=1603053&r2=1603054&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/deflate/DeflateCompressorInputStream.java
(original)
+++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/deflate/DeflateCompressorInputStream.java
Tue Jun 17 04:33:24 2014
@@ -52,7 +52,7 @@ public class DeflateCompressorInputStrea
      */
     public DeflateCompressorInputStream(InputStream inputStream,
                                         DeflateParameters parameters) {
-        in = new InflaterInputStream(inputStream, new Inflater(!parameters.isZlibHeaderPresent()));
+        in = new InflaterInputStream(inputStream, new Inflater(!parameters.withZlibHeader()));
     }
     
     /** {@inheritDoc} */

Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/deflate/DeflateCompressorOutputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/deflate/DeflateCompressorOutputStream.java?rev=1603054&r1=1603053&r2=1603054&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/deflate/DeflateCompressorOutputStream.java
(original)
+++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/deflate/DeflateCompressorOutputStream.java
Tue Jun 17 04:33:24 2014
@@ -44,7 +44,7 @@ public class DeflateCompressorOutputStre
      */
     public DeflateCompressorOutputStream(OutputStream outputStream,
                                          DeflateParameters parameters) throws IOException
{
-        this.out = new DeflaterOutputStream(outputStream, new Deflater(parameters.getCompressionLevel(),
!parameters.isZlibHeaderPresent()));
+        this.out = new DeflaterOutputStream(outputStream, new Deflater(parameters.getCompressionLevel(),
!parameters.withZlibHeader()));
     }
 
     @Override

Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/deflate/DeflateParameters.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/deflate/DeflateParameters.java?rev=1603054&r1=1603053&r2=1603054&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/deflate/DeflateParameters.java
(original)
+++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/deflate/DeflateParameters.java
Tue Jun 17 04:33:24 2014
@@ -27,23 +27,33 @@ import java.util.zip.Deflater;
  */
 public class DeflateParameters {
 
-    private boolean zlibHeaderPresent = true;
+    private boolean zlibHeader = true;
     private int compressionLevel = Deflater.DEFAULT_COMPRESSION;
 
-    public boolean isZlibHeaderPresent() {
-        return zlibHeaderPresent;
+    /**
+     * Whether or not the zlib header shall be written (when
+     * compressing) or expected (when decompressing).
+     */
+    public boolean withZlibHeader() {
+        return zlibHeader;
     }
 
     /**
      * Sets the zlib header presence parameter.
-     * This affects whether or not the zlib header will be written (when compressing) or
expected (when decompressing).
      *
-     * @param zlibHeaderPresent
+     * <p>This affects whether or not the zlib header will be written
+     * (when compressing) or expected (when decompressing).</p>
+     *
+     * @param zlibHeader
      */
-    public void setZlibHeaderPresent(boolean zlibHeaderPresent) {
-        this.zlibHeaderPresent = zlibHeaderPresent;
+    public void setWithZlibHeader(boolean zlibHeader) {
+        this.zlibHeader = zlibHeader;
     }
 
+    /**
+     * The compression level.
+     * @see #setCompressionLevel
+     */
     public int getCompressionLevel() {
         return compressionLevel;
     }

Modified: commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/compressors/DeflateTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/compressors/DeflateTestCase.java?rev=1603054&r1=1603053&r2=1603054&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/compressors/DeflateTestCase.java
(original)
+++ commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/compressors/DeflateTestCase.java
Tue Jun 17 04:33:24 2014
@@ -53,7 +53,7 @@ public final class DeflateTestCase exten
             out.close();
         }
     }
-    
+
     /**
      * Tests the creation of a "raw" DEFLATE archive (without zlib header)
      * 
@@ -64,8 +64,8 @@ public final class DeflateTestCase exten
         final File output = new File(dir, "test1.xml.deflate");
         final OutputStream out = new FileOutputStream(output);
         try {
-        	DeflateParameters params = new DeflateParameters();
-        	params.setZlibHeaderPresent(false);
+            DeflateParameters params = new DeflateParameters();
+            params.setWithZlibHeader(false);
             final CompressorOutputStream cos = new DeflateCompressorOutputStream(out, params);
             try {
                 IOUtils.copy(new FileInputStream(input), cos);
@@ -103,7 +103,7 @@ public final class DeflateTestCase exten
             is.close();
         }
     }
-    
+
     /**
      * Tests the extraction of a "raw" DEFLATE archive (without zlib header)
      * 
@@ -114,8 +114,8 @@ public final class DeflateTestCase exten
         final File output = new File(dir, "bla.tar");
         final InputStream is = new FileInputStream(input);
         try {
-        	DeflateParameters params = new DeflateParameters();
-        	params.setZlibHeaderPresent(false);
+            DeflateParameters params = new DeflateParameters();
+            params.setWithZlibHeader(false);
             final CompressorInputStream in = new DeflateCompressorInputStream(is, params);
             FileOutputStream out = null;
             try {



Mime
View raw message