fixed deprecations,
fixed imports,
noticed the TarArchive test data is broken
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/sandbox/compress/trunk@494348 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/examples/org/apache/commons/compress/examples/BZip2Example.java b/src/examples/org/apache/commons/compress/examples/BZip2Example.java
index 8b4727e..84a148c 100755
--- a/src/examples/org/apache/commons/compress/examples/BZip2Example.java
+++ b/src/examples/org/apache/commons/compress/examples/BZip2Example.java
@@ -28,13 +28,9 @@
import org.apache.commons.compress.CompressException;
import org.apache.commons.compress.Compressor;
import org.apache.commons.compress.CompressorFactory;
-/**
- * BZIP2 .Example
- */
+
public class BZip2Example {
- /**
- *
- */
+
public BZip2Example() {
super();
}
diff --git a/src/examples/org/apache/commons/compress/examples/Bzip2Compress.java b/src/examples/org/apache/commons/compress/examples/Bzip2Compress.java
index 4763b4f..3742f57 100755
--- a/src/examples/org/apache/commons/compress/examples/Bzip2Compress.java
+++ b/src/examples/org/apache/commons/compress/examples/Bzip2Compress.java
@@ -21,9 +21,6 @@
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
import org.apache.commons.compress.CompressUtils;
import org.apache.commons.compress.compressors.bzip2.BZip2OutputStream;
@@ -59,15 +56,15 @@
/**
* Copy bytes from an <code>InputStream</code> to an <code>OutputStream</code>.
*/
- private static void copy( final InputStream input,
- final OutputStream output )
- throws IOException
- {
- final byte[] buffer = new byte[ 8024 ];
- int n = 0;
- while( -1 != ( n = input.read( buffer ) ) )
- {
- output.write( buffer, 0, n );
- }
- }
+// private static void copy( final InputStream input,
+// final OutputStream output )
+// throws IOException
+// {
+// final byte[] buffer = new byte[ 8024 ];
+// int n = 0;
+// while( -1 != ( n = input.read( buffer ) ) )
+// {
+// output.write( buffer, 0, n );
+// }
+// }
}
diff --git a/src/examples/org/apache/commons/compress/examples/Bzip2Uncompress.java b/src/examples/org/apache/commons/compress/examples/Bzip2Uncompress.java
index f431def..9c7a022 100755
--- a/src/examples/org/apache/commons/compress/examples/Bzip2Uncompress.java
+++ b/src/examples/org/apache/commons/compress/examples/Bzip2Uncompress.java
@@ -21,9 +21,6 @@
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
import org.apache.commons.compress.CompressUtils;
import org.apache.commons.compress.compressors.bzip2.BZip2InputStream;
@@ -65,15 +62,15 @@
/**
* Copy bytes from an <code>InputStream</code> to an <code>OutputStream</code>.
*/
- private static void copy( final InputStream input,
- final OutputStream output )
- throws IOException
- {
- final byte[] buffer = new byte[ 8024 ];
- int n = 0;
- while( -1 != ( n = input.read( buffer ) ) )
- {
- output.write( buffer, 0, n );
- }
- }
+// private static void copy( final InputStream input,
+// final OutputStream output )
+// throws IOException
+// {
+// final byte[] buffer = new byte[ 8024 ];
+// int n = 0;
+// while( -1 != ( n = input.read( buffer ) ) )
+// {
+// output.write( buffer, 0, n );
+// }
+// }
}
diff --git a/src/java/org/apache/commons/compress/PackableObject.java b/src/java/org/apache/commons/compress/PackableObject.java
index 5541ba2..fcb089d 100755
--- a/src/java/org/apache/commons/compress/PackableObject.java
+++ b/src/java/org/apache/commons/compress/PackableObject.java
@@ -90,7 +90,7 @@
try {
/* Archive result */
- PackableObject packable = null;
+ //PackableObject packable = null;
// identify archive by header
fis = new FileInputStream(file);
diff --git a/src/java/org/apache/commons/compress/archivers/tar/TarArchive.java b/src/java/org/apache/commons/compress/archivers/tar/TarArchive.java
index 5048849..623420e 100755
--- a/src/java/org/apache/commons/compress/archivers/tar/TarArchive.java
+++ b/src/java/org/apache/commons/compress/archivers/tar/TarArchive.java
@@ -125,10 +125,10 @@
*/
public void doSave(FileOutputStream output) throws ArchiveException {
// Stream initializing
- BufferedInputStream origin = null;
+ //BufferedInputStream origin = null;
//out.setMethod(ZipOutputStream.DEFLATED);
- byte data[] = new byte[BUFFER];
+ //byte data[] = new byte[BUFFER];
// get a list of files from current directory
// less than one file leads to an exception
diff --git a/src/java/org/apache/commons/compress/archivers/tar/TarEntry.java b/src/java/org/apache/commons/compress/archivers/tar/TarEntry.java
index 3a5c1c1..4a86345 100755
--- a/src/java/org/apache/commons/compress/archivers/tar/TarEntry.java
+++ b/src/java/org/apache/commons/compress/archivers/tar/TarEntry.java
@@ -126,7 +126,7 @@
* LF_ constants represent the "link flag" of an entry, or more commonly,
* the "entry type". This is the "old way" of indicating a normal file.
*/
- private final static byte LF_OLDNORM = 0;
+ //private final static byte LF_OLDNORM = 0;
/**
* Normal file type.
@@ -136,22 +136,22 @@
/**
* Link file type.
*/
- private final static byte LF_LINK = (byte)'1';
+ //private final static byte LF_LINK = (byte)'1';
/**
* Symbolic link file type.
*/
- private final static byte LF_SYMLINK = (byte)'2';
+ //private final static byte LF_SYMLINK = (byte)'2';
/**
* Character device file type.
*/
- private final static byte LF_CHR = (byte)'3';
+ //private final static byte LF_CHR = (byte)'3';
/**
* Block device file type.
*/
- private final static byte LF_BLK = (byte)'4';
+ //private final static byte LF_BLK = (byte)'4';
/**
* Directory file type.
@@ -161,12 +161,12 @@
/**
* FIFO (pipe) file type.
*/
- private final static byte LF_FIFO = (byte)'6';
+ //private final static byte LF_FIFO = (byte)'6';
/**
* Contiguous file type.
*/
- private final static byte LF_CONTIG = (byte)'7';
+ //private final static byte LF_CONTIG = (byte)'7';
/**
* The magic tag representing a POSIX tar archive.
@@ -176,7 +176,7 @@
/**
* The magic tag representing a GNU tar archive.
*/
- private final static String GNU_TMAGIC = "ustar ";
+ //private final static String GNU_TMAGIC = "ustar ";
/**
* The name of the GNU tar entry which contains a long name.
@@ -190,11 +190,6 @@
-
-
-
-
-
/**
* The length of the name field in a header buffer.
*/
diff --git a/src/java/org/apache/commons/compress/compressors/bzip2/BZip2Compressor.java b/src/java/org/apache/commons/compress/compressors/bzip2/BZip2Compressor.java
index 58d99b3..6a5ee50 100755
--- a/src/java/org/apache/commons/compress/compressors/bzip2/BZip2Compressor.java
+++ b/src/java/org/apache/commons/compress/compressors/bzip2/BZip2Compressor.java
@@ -93,8 +93,8 @@
private BZip2InputStream getPackedInput( final InputStream input )
throws IOException {
// skips the 'BZ' header bytes required by the BZip2InputStream class
- final int b1 = input.read();
- final int b2 = input.read();
+ input.read();
+ input.read();
return new BZip2InputStream( input );
}
diff --git a/src/test/org/apache/commons/compress/archivers/tar/update-tars.bat b/src/test/org/apache/commons/compress/archivers/tar/update-tars.bat
deleted file mode 100755
index 355b2f2..0000000
--- a/src/test/org/apache/commons/compress/archivers/tar/update-tars.bat
+++ /dev/null
@@ -1,3 +0,0 @@
-copy gnu2.tar gnu.tar
-copy posix2.tar posix.tar
-pause
\ No newline at end of file
diff --git a/src/test/org/apache/commons/compress/compressors/bzip2/BzipTestCase.java b/src/test/org/apache/commons/compress/compressors/bzip2/BzipTestCase.java
index 786888d..10fe8fe 100755
--- a/src/test/org/apache/commons/compress/compressors/bzip2/BzipTestCase.java
+++ b/src/test/org/apache/commons/compress/compressors/bzip2/BzipTestCase.java
@@ -115,17 +115,17 @@
/**
* Copy bytes from an <code>InputStream</code> to an <code>OutputStream</code>.
*/
- private void copy( final InputStream input,
- final OutputStream output )
- throws IOException
- {
- final byte[] buffer = new byte[ 8024 ];
- int n = 0;
- while( -1 != ( n = input.read( buffer ) ) )
- {
- output.write( buffer, 0, n );
- }
- }
+// private void copy( final InputStream input,
+// final OutputStream output )
+// throws IOException
+// {
+// final byte[] buffer = new byte[ 8024 ];
+// int n = 0;
+// while( -1 != ( n = input.read( buffer ) ) )
+// {
+// output.write( buffer, 0, n );
+// }
+// }
private void compareContents( final String initial, final File generated )
throws Exception
diff --git a/src/test/org/apache/commons/compress/zip/AsiExtraFieldTestCase.java b/src/test/org/apache/commons/compress/zip/AsiExtraFieldTestCase.java
index e4eb066..8aba128 100755
--- a/src/test/org/apache/commons/compress/zip/AsiExtraFieldTestCase.java
+++ b/src/test/org/apache/commons/compress/zip/AsiExtraFieldTestCase.java
@@ -54,7 +54,7 @@
{
final AsiExtraField field = new AsiExtraField();
field.setMode( 0123 );
- field.setUserId( 5 );
+ field.setUserID( 5 );
field.setGroupId( 6 );
return field;
}
@@ -113,7 +113,7 @@
assertTrue( "plain file, no link", !field.isLink() );
assertTrue( "plain file, no dir", !field.isDirectory() );
assertEquals( "mode plain file", FILE_FLAG | 0123, field.getMode() );
- assertEquals( "uid plain file", 5, field.getUserId() );
+ assertEquals( "uid plain file", 5, field.getUserID() );
assertEquals( "gid plain file", 6, field.getGroupID() );
}
@@ -132,7 +132,7 @@
assertTrue( "link, is link", field.isLink() );
assertTrue( "link, no dir", !field.isDirectory() );
assertEquals( "mode link", LINK_FLAG | 0123, field.getMode() );
- assertEquals( "uid link", 5, field.getUserId() );
+ assertEquals( "uid link", 5, field.getUserID() );
assertEquals( "gid link", 6, field.getGroupID() );
assertEquals( "test", field.getLinkedFile() );
}
@@ -151,7 +151,7 @@
assertTrue( "dir, no link", !field.isLink() );
assertTrue( "dir, is dir", field.isDirectory() );
assertEquals( "mode dir", DIR_FLAG | 0123, field.getMode() );
- assertEquals( "uid dir", 5, field.getUserId() );
+ assertEquals( "uid dir", 5, field.getUserID() );
assertEquals( "gid dir", 6, field.getGroupID() );
}
diff --git a/src/test/org/apache/commons/compress/zip/ExtraFieldUtilsTestCase.java b/src/test/org/apache/commons/compress/zip/ExtraFieldUtilsTestCase.java
index 51df224..ebb8f3b 100755
--- a/src/test/org/apache/commons/compress/zip/ExtraFieldUtilsTestCase.java
+++ b/src/test/org/apache/commons/compress/zip/ExtraFieldUtilsTestCase.java
@@ -46,7 +46,7 @@
m_field.setMode( 0755 );
m_field.setDirectory( true );
m_dummy = new UnrecognizedExtraField();
- m_dummy.setHeaderId( new ZipShort( 1 ) );
+ m_dummy.setHeaderID( new ZipShort( 1 ) );
m_dummy.setLocalFileDataData( new byte[ 0 ] );
m_dummy.setCentralDirectoryData( new byte[]{0} );
diff --git a/src/test/org/apache/commons/compress/zip/ZipEntryTestCase.java b/src/test/org/apache/commons/compress/zip/ZipEntryTestCase.java
index af14d33..7a86184 100755
--- a/src/test/org/apache/commons/compress/zip/ZipEntryTestCase.java
+++ b/src/test/org/apache/commons/compress/zip/ZipEntryTestCase.java
@@ -52,7 +52,7 @@
assertSame( extraField, result[ 1 ] );
UnrecognizedExtraField u2 = new UnrecognizedExtraField();
- u2.setHeaderId( new ZipShort( 1 ) );
+ u2.setHeaderID( new ZipShort( 1 ) );
u2.setLocalFileDataData( new byte[]{1} );
entry.addExtraField( u2 );
@@ -64,7 +64,7 @@
assertEquals( "length second pass", data1.length + 1, data2.length );
UnrecognizedExtraField u3 = new UnrecognizedExtraField();
- u3.setHeaderId( new ZipShort( 2 ) );
+ u3.setHeaderID( new ZipShort( 2 ) );
u3.setLocalFileDataData( new byte[]{1} );
entry.addExtraField( u3 );
result = entry.getExtraFields();
@@ -91,7 +91,7 @@
private UnrecognizedExtraField createExtraField()
{
UnrecognizedExtraField extraField = new UnrecognizedExtraField();
- extraField.setHeaderId( new ZipShort( 1 ) );
+ extraField.setHeaderID( new ZipShort( 1 ) );
extraField.setLocalFileDataData( new byte[ 0 ] );
return extraField;
}