Test Blame

src/test/java/org/apache/commons/compress/archivers/dump/DumpArchiveInputStreamTest.java
TagDateBlameLineSource
  COMPRESS_1.3_RC2    Thu Oct 27 12:32:53 UTC 2011    e43a80  27
    public void testNotADumpArchive() throws Exception {
  COMPRESS_1.3_RC2    Thu Oct 27 12:32:53 UTC 2011    e43a80  28
        FileInputStream is = new FileInputStream(getFile("bla.zip"));
  COMPRESS_1.3_RC2    Thu Oct 27 12:32:53 UTC 2011    e43a80  29
        try {
  COMPRESS_1.3_RC2    Thu Oct 27 12:32:53 UTC 2011    e43a80  30
            new DumpArchiveInputStream(is);
  COMPRESS_1.3_RC2    Thu Oct 27 12:32:53 UTC 2011    e43a80  31
            fail("expected an exception");
  COMPRESS_1.3_RC2    Thu Oct 27 12:32:53 UTC 2011    e43a80  32
        } catch (ArchiveException ex) {
  COMPRESS_1.3_RC2    Thu Oct 27 12:32:53 UTC 2011    e43a80  33
            // expected
  COMPRESS_1.3_RC2    Thu Oct 27 12:32:53 UTC 2011    e43a80  34
            assertTrue(ex.getCause() instanceof ShortFileException);
  COMPRESS_1.3_RC2    Thu Oct 27 12:32:53 UTC 2011    e43a80  35
        } finally {
  COMPRESS_1.3_RC2    Thu Oct 27 12:32:53 UTC 2011    e43a80  36
            is.close();
  COMPRESS_1.3_RC2    Thu Oct 27 12:32:53 UTC 2011    e43a80  37
        }
  COMPRESS_1.3_RC2    Thu Oct 27 12:32:53 UTC 2011    e43a80  38
    }

Found Source Blame

src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveInputStream.java
TagDateBlameLineSource
  COMPRESS_1.3_RC1    Mon Aug 15 10:47:04 UTC 2011    054452  52
    private byte[] readBuf = new byte[DumpArchiveConstants.TP_SIZE];
  COMPRESS_1.3_RC1    Mon Aug 15 10:47:04 UTC 2011    054452  59
    private Map names = new HashMap();
  COMPRESS_1.3_RC1    Mon Aug 15 10:47:04 UTC 2011    054452  62
    private Map pending = new HashMap();
  COMPRESS_1.3_RC1    Mon Aug 15 11:14:58 UTC 2011    a93236  73
    public DumpArchiveInputStream(InputStream is) throws ArchiveException {
  COMPRESS_1.3_RC1    Sun Oct 23 11:48:59 UTC 2011    41fc7c  74
        this.raw = new TapeInputStream(is);
  COMPRESS_1.3_RC1    Mon Aug 15 10:47:04 UTC 2011    054452  75
        this.hasHitEOF = false;
  COMPRESS_1.3_RC1    Mon Aug 15 11:14:58 UTC 2011    a93236  97
        } catch (IOException ex) {
  COMPRESS_1.3_RC1    Mon Aug 15 11:14:58 UTC 2011    a93236  98
            throw new ArchiveException(ex.getMessage(), ex);
src/main/java/org/apache/commons/compress/archivers/dump/TapeInputStream.java
TagDateBlameLineSource
  COMPRESS_1.3_RC1    Mon Aug 15 10:47:04 UTC 2011    054452  37
    private byte[] blockBuffer = new byte[DumpArchiveConstants.TP_SIZE];
  COMPRESS_1.3_RC1    Mon Aug 15 10:47:04 UTC 2011    054452  38
    private int currBlkIdx = -1;
  COMPRESS_1.3_RC1    Mon Aug 15 10:47:04 UTC 2011    054452  39
    private int blockSize = DumpArchiveConstants.TP_SIZE;
  COMPRESS_1.3_RC1    Mon Aug 15 10:47:04 UTC 2011    054452  40
    private int recordSize = DumpArchiveConstants.TP_SIZE;
  COMPRESS_1.3_RC1    Mon Aug 15 10:47:04 UTC 2011    054452  41
    private int readOffset = DumpArchiveConstants.TP_SIZE;
  COMPRESS_1.3_RC1    Mon Aug 15 10:47:04 UTC 2011    054452  42
    private boolean isCompressed = false;
  COMPRESS_1.3_RC1    Mon Aug 15 10:47:04 UTC 2011    054452  43
    private long bytesRead = 0;
  COMPRESS_1.3_RC1    Mon Aug 15 10:47:04 UTC 2011    054452  49
        super(in);
  COMPRESS_1.3_RC1    Mon Aug 15 10:47:04 UTC 2011    054452  50
    }
  COMPRESS_1.3_RC1    Mon Aug 15 10:47:04 UTC 2011    054452  116
        if ((len % recordSize) != 0) {
  COMPRESS_1.3_RC1    Mon Aug 15 10:47:04 UTC 2011    054452  122
        int bytes = 0;
  COMPRESS_1.3_RC1    Mon Aug 15 10:47:04 UTC 2011    054452  124
        while (bytes < len) {
  COMPRESS_1.3_RC1    Mon Aug 15 10:47:04 UTC 2011    054452  238
        byte[] result = new byte[recordSize];
  COMPRESS_1.3_RC1    Mon Aug 15 10:47:04 UTC 2011    054452  255
        boolean success = true;
  COMPRESS_1.3_RC1    Mon Aug 15 10:47:04 UTC 2011    054452  257
        if (in == null) {
  COMPRESS_1.3_RC1    Mon Aug 15 10:47:04 UTC 2011    054452  261
        if (!isCompressed || (currBlkIdx == -1)) {
  COMPRESS_1.3_RC1    Mon Aug 15 10:47:04 UTC 2011    054452  336
        int count = 0;
  COMPRESS_1.3_RC1    Mon Aug 15 10:47:04 UTC 2011    054452  338
        while (count < len) {
  COMPRESS_1.3_RC1    Mon Aug 15 10:47:04 UTC 2011    054452  339
            int n = in.read(b, off + count, len - count);
  COMPRESS_1.3_RC1    Mon Aug 15 10:47:04 UTC 2011    054452  341
            if (n == -1) {
  COMPRESS_1.3_RC1    Mon Aug 15 10:47:04 UTC 2011    054452  342
                throw new ShortFileException();
  COMPRESS_1.3_RC1    Mon Aug 15 10:47:04 UTC 2011    054452  345
            count += n;
  COMPRESS_1.3_RC1    Mon Aug 15 10:47:04 UTC 2011    054452  346
        }
src/main/java/org/apache/commons/compress/archivers/ArchiveException.java
TagDateBlameLineSource
  commons-compress-1.1    Tue Mar 02 23:27:18 UTC 2010    c640fa  49
        super(message);
  commons-compress-1.1    Tue Mar 02 23:27:18 UTC 2010    c640fa  50
        this.initCause(cause);
  commons-compress-1.1    Tue Mar 02 23:27:18 UTC 2010    c640fa  51
    }
src/main/java/org/apache/commons/compress/archivers/dump/ShortFileException.java
TagDateBlameLineSource
  COMPRESS_1.3_RC1    Mon Aug 15 10:47:04 UTC 2011    054452  30
        super("unexpected EOF");
  COMPRESS_1.3_RC1    Mon Aug 15 10:47:04 UTC 2011    054452  31
    }
src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveException.java
TagDateBlameLineSource
  COMPRESS_1.3_RC1    Mon Aug 15 10:47:04 UTC 2011    054452  34
        super(msg);
  COMPRESS_1.3_RC1    Mon Aug 15 10:47:04 UTC 2011    054452  35
    }
src/main/java/org/apache/commons/compress/archivers/ArchiveStreamFactory.java
TagDateBlameLineSource
  compress_sandbox_03_2009    Wed Jan 07 13:16:01 UTC 2009    6a7032  74
public class ArchiveStreamFactory {
src/main/java/org/apache/commons/compress/archivers/ArchiveInputStream.java
TagDateBlameLineSource
  compress_sandbox_03_2009    Thu Jul 10 10:17:44 UTC 2008    ca1653  40
public abstract class ArchiveInputStream extends InputStream {
  rel/1.0    Mon Mar 30 18:10:45 UTC 2009    253196  42
    private byte[] SINGLE = new byte[1];
  commons-compress-1.1    Thu Feb 18 16:10:20 UTC 2010    2dca66  46
    private long bytesRead = 0;