commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christian Grobmeier (JIRA)" <j...@apache.org>
Subject [jira] Commented: (SANDBOX-305) CPIO reports unexpected EOF
Date Fri, 20 Mar 2009 07:02:50 GMT

    [ https://issues.apache.org/jira/browse/SANDBOX-305?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12683773#action_12683773
] 

Christian Grobmeier commented on SANDBOX-305:
---------------------------------------------

In my cpio are two xml files, test1.xml and test2.xml.
test1.xml's header can be read. The file is written to the disc from the correct start point.
But it looks like cpio cannot find the end of my file. It simply writes the rest of the archive
too into test1.xml till the stream ended. After that the EOF raises.

To make it more clear. test1.xml contains something like that:

<?xml version = '1.0'?>
<!DOCTYPE connections>
<connections>
</connections>
07070200042db5000081a4000001f5000001f50000000149c1df900000004e0000000e0000000500
000000000000000000000a00001802test2.xml^@<?xml version = '1.0'?>
<!DOCTYPE connections>
<meinxml>
        <leer />
</meinxml>
^@^@0707020000000000000000000000000000000000000001000000000000000000000000000000
0000000000000000000000000b00000000TRAILER!!!^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@

> CPIO reports unexpected EOF
> ---------------------------
>
>                 Key: SANDBOX-305
>                 URL: https://issues.apache.org/jira/browse/SANDBOX-305
>             Project: Commons Sandbox
>          Issue Type: Bug
>          Components: Compress
>            Reporter: Christian Grobmeier
>
> When unpacking an CPIO archive (made with the compress classes or even made with OSX
cpio comandline tool) an EOF exception is thrown.
> Here is the testcode:
>         final File input = getFile("cmdcreated.cpio");
>         final InputStream in = new FileInputStream(input);
>         CpioArchiveInputStream cin = new CpioArchiveInputStream(in);
>         CpioArchiveEntry entry = null;
>         while ((entry = (CpioArchiveEntry) cin.getNextCPIOEntry()) != null) {
>             File target = new File(dir, entry.getName());
>             final OutputStream out = new FileOutputStream(target);
>             IOUtils.copy(in, out);
>             out.close();
>         }
>         cin.close();
> Stacktrace is here:
> java.io.EOFException
> 	at org.apache.commons.compress.archivers.cpio.CpioArchiveInputStream.readFully(CpioArchiveInputStream.java:293)
> 	at org.apache.commons.compress.archivers.cpio.CpioArchiveInputStream.getNextCPIOEntry(CpioArchiveInputStream.java:168)
> 	at org.apache.commons.compress.archivers.cpio.CpioArchiveInputStreamTest.testCpioUnpack(CpioArchiveInputStreamTest.java:26)
> 	...
> This happens with the first read access to the archive. It occured while my try to improve
the testcases.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message