You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to use Zips to construct a zip file containing an arbitrary set of entries, using FileSource objects. However, if the FileSource refers to a directory, it results in a "Stream closed" exception:
at java.io.BufferedInputStream.read(BufferedInputStream.java:345)
at java.io.FilterInputStream.read(FilterInputStream.java:107)
at org.zeroturnaround.zip.commons.IOUtils.copyLarge(IOUtils.java:322)
at org.zeroturnaround.zip.commons.IOUtils.copyLarge(IOUtils.java:299)
at org.zeroturnaround.zip.commons.IOUtils.copy(IOUtils.java:274)
at org.zeroturnaround.zip.ZipEntryUtil.addEntry(ZipEntryUtil.java:131)
at org.zeroturnaround.zip.ZipEntryUtil.copyEntry(ZipEntryUtil.java:115)
at org.zeroturnaround.zip.Zips$CopyingCallback.process(Zips.java:655)
at org.zeroturnaround.zip.ZipEntryOrInfoAdapter.process(ZipEntryOrInfoAdapter.java:26)
at org.zeroturnaround.zip.Zips.iterateChangedAndAdded(Zips.java:569)
... 4 more
I think the source of the bug is in this method: ZipEntryUtil#copyEntry(java.util.zip.ZipEntry, java.io.InputStream, java.util.zip.ZipOutputStream, boolean),
where on line 115 it does this: addEntry(copy, new BufferedInputStream(in), out)
Instead it should do this: addEntry(copy, in == null ? null : new BufferedInputStream(in), out) so the called method does not try to read from the input stream.
The text was updated successfully, but these errors were encountered:
I was trying to use Zips to construct a zip file containing an arbitrary set of entries, using FileSource objects. However, if the FileSource refers to a directory, it results in a "Stream closed" exception:
I think the source of the bug is in this method:
ZipEntryUtil#copyEntry(java.util.zip.ZipEntry, java.io.InputStream, java.util.zip.ZipOutputStream, boolean)
,where on line 115 it does this:
addEntry(copy, new BufferedInputStream(in), out)
Instead it should do this:
addEntry(copy, in == null ? null : new BufferedInputStream(in), out)
so the called method does not try to read from the input stream.The text was updated successfully, but these errors were encountered: