Author: bodewig
Date: Tue Dec 10 12:59:50 2013
New Revision: 1549831
URL: http://svn.apache.org/r1549831
Log:
some explicit checks as long as ZipArchiveInputStream doesn't support
unshrinking
Modified:
commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.java
Modified:
commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.java
URL:
http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.java?rev=1549831&r1=1549830&r2=1549831&view=diff
==============================================================================
---
commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.java
(original)
+++
commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.java
Tue Dec 10 12:59:50 2013
@@ -366,6 +366,7 @@ public class ZipArchiveInputStream exten
if (ae instanceof ZipArchiveEntry) {
ZipArchiveEntry ze = (ZipArchiveEntry) ae;
return ZipUtil.canHandleEntryData(ze)
+ && ze.getMethod() == ZipMethod.UNSHRINKING.getCode()
&& supportsDataDescriptorFor(ze);
}
@@ -395,6 +396,10 @@ public class ZipArchiveInputStream exten
if (current.entry.getMethod() == ZipArchiveOutputStream.STORED) {
return readStored(buffer, start, length);
}
+ if (current.entry.getMethod() == ZipMethod.UNSHRINKING.getCode()) {
+ throw new UnsupportedZipFeatureException(ZipMethod.UNSHRINKING,
+ current.entry);
+ }
return readDeflated(buffer, start, length);
}
throw new ArrayIndexOutOfBoundsException();