[shrinkwrap-issues] [JBoss JIRA] Commented: (SHRINKWRAP-93) ZipExporter should throw exception for empty archives

Aslak (JIRA) jira-events at lists.jboss.org
Wed Dec 2 17:06:11 EST 2009


    [ https://jira.jboss.org/jira/browse/SHRINKWRAP-93?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12497856#action_12497856 ] 

Aslak commented on SHRINKWRAP-93:
---------------------------------

It seems to be ok to create a zip file and delete all the entries via some 'external' zip tool, but.. 

In ShrinkWrap we swallow a exception thrown on ZipOutputStream.close in IOUtil.closeOnComplete.
{code}
      finally
      {
         try
         {
            if (stream != null)
            {
               stream.close();
            }
         }
         catch (Exception ex)
         {
         }
      }
{code}

What's actually happening is this:

{code}
java.util.zip.ZipException: ZIP file must have at least one entry
	at java.util.zip.ZipOutputStream.finish(ZipOutputStream.java:321)
	at java.util.zip.DeflaterOutputStream.close(DeflaterOutputStream.java:163)
	at java.util.zip.ZipOutputStream.close(ZipOutputStream.java:338)
	at org.jboss.shrinkwrap.impl.base.io.IOUtil.closeOnComplete(IOUtil.java:217)
	at org.jboss.shrinkwrap.impl.base.exporter.ZipExportDelegate.export(ZipExportDelegate.java:85)
	at org.jboss.shrinkwrap.impl.base.exporter.ZipExporterImpl.exportZip(ZipExporterImpl.java:90)
	at org.jboss.shrinkwrap.impl.base.exporter.ZipExporterTestCase.testExportEmptyArchive(ZipExporterTestCase.java:185)
{code}

Javas ZipOutputStream doesn't seem to support it.. 

> ZipExporter should throw exception for empty archives
> -----------------------------------------------------
>
>                 Key: SHRINKWRAP-93
>                 URL: https://jira.jboss.org/jira/browse/SHRINKWRAP-93
>             Project: ShrinkWrap
>          Issue Type: Feature Request
>          Components: api, impl-base
>    Affects Versions: 1.0.0-alpha-2
>            Reporter: Jesper Pedersen
>            Priority: Minor
>
> ZipExporter should throw exception for empty archives as it won't produce a valid zip file.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the shrinkwrap-issues mailing list