[jira] [Created] (COMPRESS-193) java.io.IOException: This archives contains unclosed entries.

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (COMPRESS-193) java.io.IOException: This archives contains unclosed entries.

Woonsan Ko (Jira)
Shishir goswami created COMPRESS-193:
----------------------------------------

             Summary: java.io.IOException: This archives contains unclosed entries.
                 Key: COMPRESS-193
                 URL: https://issues.apache.org/jira/browse/COMPRESS-193
             Project: Commons Compress
          Issue Type: Bug
         Environment: Windows Server 2008 R2
            Reporter: Shishir goswami


I am getting java.io.IOException: This archives contains unclosed entries.Below is the code. Any help is much appreciated

final File output = new File("c:\\testdata", "shishir.zip");
    final File file1 = new File ("C:\\testdata\test1.xml");
    final File file2 = new File ("C:\\testdata\test2.xml");

    final OutputStream out = new FileOutputStream(output);
    ArchiveOutputStream os = null;
    FileInputStream input1=null;
    FileInputStream input2=null;
    try {
        os = new ArchiveStreamFactory()
            .createArchiveOutputStream("zip", out);
        os.putArchiveEntry(new ZipArchiveEntry("testdata\test1.xml"));
     input1 = new FileInputStream(file1);
       IOUtils.copy(input1, os);
       input1.close();
        os.closeArchiveEntry();
       input2 = new FileInputStream(file2);
       input2.close();
        os.putArchiveEntry(new ZipArchiveEntry("testdata\test2.xml"));
        IOUtils.copy(input2, os);
        os.closeArchiveEntry();
        os.finish();
    } finally {
        if (os != null) {

            os.close();
        }else if (out != null) {
                        out.close();
                }
 
    }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Updated] (COMPRESS-193) java.io.IOException: This archives contains unclosed entries.

Woonsan Ko (Jira)

     [ https://issues.apache.org/jira/browse/COMPRESS-193?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sebb updated COMPRESS-193:
--------------------------

    Description:
I am getting java.io.IOException: This archives contains unclosed entries.
Below is the code. Any help is much appreciated

{code}
final File output = new File("c:\\testdata", "shishir.zip");
final File file1 = new File ("C:\\testdata\test1.xml");
final File file2 = new File ("C:\\testdata\test2.xml");

final OutputStream out = new FileOutputStream(output);
ArchiveOutputStream os = null;
FileInputStream input1=null;
FileInputStream input2=null;
try {
    os = new ArchiveStreamFactory()
        .createArchiveOutputStream("zip", out);
    os.putArchiveEntry(new ZipArchiveEntry("testdata\test1.xml"));
    input1 = new FileInputStream(file1);
    IOUtils.copy(input1, os);
    input1.close();
    os.closeArchiveEntry();
    input2 = new FileInputStream(file2);
    input2.close();
    os.putArchiveEntry(new ZipArchiveEntry("testdata\test2.xml"));
    IOUtils.copy(input2, os);
    os.closeArchiveEntry();
    os.finish();
} finally {
    if (os != null) {
        os.close();
    }else if (out != null) {
        out.close();
    }
}
{code}

  was:
I am getting java.io.IOException: This archives contains unclosed entries.Below is the code. Any help is much appreciated

final File output = new File("c:\\testdata", "shishir.zip");
    final File file1 = new File ("C:\\testdata\test1.xml");
    final File file2 = new File ("C:\\testdata\test2.xml");

    final OutputStream out = new FileOutputStream(output);
    ArchiveOutputStream os = null;
    FileInputStream input1=null;
    FileInputStream input2=null;
    try {
        os = new ArchiveStreamFactory()
            .createArchiveOutputStream("zip", out);
        os.putArchiveEntry(new ZipArchiveEntry("testdata\test1.xml"));
     input1 = new FileInputStream(file1);
       IOUtils.copy(input1, os);
       input1.close();
        os.closeArchiveEntry();
       input2 = new FileInputStream(file2);
       input2.close();
        os.putArchiveEntry(new ZipArchiveEntry("testdata\test2.xml"));
        IOUtils.copy(input2, os);
        os.closeArchiveEntry();
        os.finish();
    } finally {
        if (os != null) {

            os.close();
        }else if (out != null) {
                        out.close();
                }
 
    }

   

> java.io.IOException: This archives contains unclosed entries.
> -------------------------------------------------------------
>
>                 Key: COMPRESS-193
>                 URL: https://issues.apache.org/jira/browse/COMPRESS-193
>             Project: Commons Compress
>          Issue Type: Bug
>         Environment: Windows Server 2008 R2
>            Reporter: Shishir goswami
>
> I am getting java.io.IOException: This archives contains unclosed entries.
> Below is the code. Any help is much appreciated
> {code}
> final File output = new File("c:\\testdata", "shishir.zip");
> final File file1 = new File ("C:\\testdata\test1.xml");
> final File file2 = new File ("C:\\testdata\test2.xml");
> final OutputStream out = new FileOutputStream(output);
> ArchiveOutputStream os = null;
> FileInputStream input1=null;
> FileInputStream input2=null;
> try {
>     os = new ArchiveStreamFactory()
>         .createArchiveOutputStream("zip", out);
>     os.putArchiveEntry(new ZipArchiveEntry("testdata\test1.xml"));
>     input1 = new FileInputStream(file1);
>     IOUtils.copy(input1, os);
>     input1.close();
>     os.closeArchiveEntry();
>     input2 = new FileInputStream(file2);
>     input2.close();
>     os.putArchiveEntry(new ZipArchiveEntry("testdata\test2.xml"));
>     IOUtils.copy(input2, os);
>     os.closeArchiveEntry();
>     os.finish();
> } finally {
>     if (os != null) {
>         os.close();
>     }else if (out != null) {
>         out.close();
>     }
> }
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Resolved] (COMPRESS-193) java.io.IOException: This archives contains unclosed entries.

Woonsan Ko (Jira)
In reply to this post by Woonsan Ko (Jira)

     [ https://issues.apache.org/jira/browse/COMPRESS-193?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sebb resolved COMPRESS-193.
---------------------------

    Resolution: Not A Problem

JIRA is not a support forum.

Please subscribe to the Commons user list and ask there.
               

> java.io.IOException: This archives contains unclosed entries.
> -------------------------------------------------------------
>
>                 Key: COMPRESS-193
>                 URL: https://issues.apache.org/jira/browse/COMPRESS-193
>             Project: Commons Compress
>          Issue Type: Bug
>         Environment: Windows Server 2008 R2
>            Reporter: Shishir goswami
>
> I am getting java.io.IOException: This archives contains unclosed entries.
> Below is the code. Any help is much appreciated
> {code}
> final File output = new File("c:\\testdata", "shishir.zip");
> final File file1 = new File ("C:\\testdata\test1.xml");
> final File file2 = new File ("C:\\testdata\test2.xml");
> final OutputStream out = new FileOutputStream(output);
> ArchiveOutputStream os = null;
> FileInputStream input1=null;
> FileInputStream input2=null;
> try {
>     os = new ArchiveStreamFactory()
>         .createArchiveOutputStream("zip", out);
>     os.putArchiveEntry(new ZipArchiveEntry("testdata\test1.xml"));
>     input1 = new FileInputStream(file1);
>     IOUtils.copy(input1, os);
>     input1.close();
>     os.closeArchiveEntry();
>     input2 = new FileInputStream(file2);
>     input2.close();
>     os.putArchiveEntry(new ZipArchiveEntry("testdata\test2.xml"));
>     IOUtils.copy(input2, os);
>     os.closeArchiveEntry();
>     os.finish();
> } finally {
>     if (os != null) {
>         os.close();
>     }else if (out != null) {
>         out.close();
>     }
> }
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (COMPRESS-193) java.io.IOException: This archives contains unclosed entries.

Woonsan Ko (Jira)
In reply to this post by Woonsan Ko (Jira)

    [ https://issues.apache.org/jira/browse/COMPRESS-193?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13408575#comment-13408575 ]

Stefan Bodewig commented on COMPRESS-193:
-----------------------------------------

you'd get that exception when an exception is thrown between any of the putArchiveEntry and corresponding closeArchiveEntry calls.
               

> java.io.IOException: This archives contains unclosed entries.
> -------------------------------------------------------------
>
>                 Key: COMPRESS-193
>                 URL: https://issues.apache.org/jira/browse/COMPRESS-193
>             Project: Commons Compress
>          Issue Type: Bug
>         Environment: Windows Server 2008 R2
>            Reporter: Shishir goswami
>
> I am getting java.io.IOException: This archives contains unclosed entries.
> Below is the code. Any help is much appreciated
> {code}
> final File output = new File("c:\\testdata", "shishir.zip");
> final File file1 = new File ("C:\\testdata\test1.xml");
> final File file2 = new File ("C:\\testdata\test2.xml");
> final OutputStream out = new FileOutputStream(output);
> ArchiveOutputStream os = null;
> FileInputStream input1=null;
> FileInputStream input2=null;
> try {
>     os = new ArchiveStreamFactory()
>         .createArchiveOutputStream("zip", out);
>     os.putArchiveEntry(new ZipArchiveEntry("testdata\test1.xml"));
>     input1 = new FileInputStream(file1);
>     IOUtils.copy(input1, os);
>     input1.close();
>     os.closeArchiveEntry();
>     input2 = new FileInputStream(file2);
>     input2.close();
>     os.putArchiveEntry(new ZipArchiveEntry("testdata\test2.xml"));
>     IOUtils.copy(input2, os);
>     os.closeArchiveEntry();
>     os.finish();
> } finally {
>     if (os != null) {
>         os.close();
>     }else if (out != null) {
>         out.close();
>     }
> }
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Comment Edited] (COMPRESS-193) java.io.IOException: This archives contains unclosed entries.

Woonsan Ko (Jira)
In reply to this post by Woonsan Ko (Jira)

    [ https://issues.apache.org/jira/browse/COMPRESS-193?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13408575#comment-13408575 ]

Stefan Bodewig edited comment on COMPRESS-193 at 7/7/12 5:03 AM:
-----------------------------------------------------------------

you'd get that exception when an exception is thrown between any of the putArchiveEntry and corresponding closeArchiveEntry calls.

Otherwise, what Sebb said.
               
      was (Author: bodewig):
    you'd get that exception when an exception is thrown between any of the putArchiveEntry and corresponding closeArchiveEntry calls.
                 

> java.io.IOException: This archives contains unclosed entries.
> -------------------------------------------------------------
>
>                 Key: COMPRESS-193
>                 URL: https://issues.apache.org/jira/browse/COMPRESS-193
>             Project: Commons Compress
>          Issue Type: Bug
>         Environment: Windows Server 2008 R2
>            Reporter: Shishir goswami
>
> I am getting java.io.IOException: This archives contains unclosed entries.
> Below is the code. Any help is much appreciated
> {code}
> final File output = new File("c:\\testdata", "shishir.zip");
> final File file1 = new File ("C:\\testdata\test1.xml");
> final File file2 = new File ("C:\\testdata\test2.xml");
> final OutputStream out = new FileOutputStream(output);
> ArchiveOutputStream os = null;
> FileInputStream input1=null;
> FileInputStream input2=null;
> try {
>     os = new ArchiveStreamFactory()
>         .createArchiveOutputStream("zip", out);
>     os.putArchiveEntry(new ZipArchiveEntry("testdata\test1.xml"));
>     input1 = new FileInputStream(file1);
>     IOUtils.copy(input1, os);
>     input1.close();
>     os.closeArchiveEntry();
>     input2 = new FileInputStream(file2);
>     input2.close();
>     os.putArchiveEntry(new ZipArchiveEntry("testdata\test2.xml"));
>     IOUtils.copy(input2, os);
>     os.closeArchiveEntry();
>     os.finish();
> } finally {
>     if (os != null) {
>         os.close();
>     }else if (out != null) {
>         out.close();
>     }
> }
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira