ppkarwasz commented on code in PR #706:
URL: https://github.com/apache/commons-compress/pull/706#discussion_r2352018877


##########
src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.java:
##########
@@ -77,6 +77,112 @@
  */
 public class ZipArchiveInputStream extends ArchiveInputStream<ZipArchiveEntry> 
implements InputStreamStatistics {
 
+    /**
+     * Abstract builder for derived classes of {@link ZipArchiveInputStream}.
+     *
+     * @param <T> The type of the {@link ZipArchiveInputStream}.
+     * @param <B> The type of the builder itself.
+     * @since 1.29.0
+     */
+    public abstract static class AbstractBuilder<T extends 
ZipArchiveInputStream, B extends AbstractBuilder<T, B>>
+            extends ArchiveInputStream.Builder<T, B> {
+        private boolean useUnicodeExtraFields = true;
+        private boolean allowStoredEntriesWithDataDescriptor;
+        private boolean skipSplitSig;
+
+        protected AbstractBuilder() {
+            setCharset(StandardCharsets.UTF_8);
+        }
+
+        /**
+         * Controls whether to use InfoZIP Unicode Extra Fields (if present) 
to set the file names.
+         *
+         * <p>This feature is enabled by default.</p>
+         *
+         * @param useUnicodeExtraFields If {@code true} Unicode Extra Fields 
should be used.
+         * @return this
+         */
+        public B setUseUnicodeExtraFields(final boolean useUnicodeExtraFields) 
{
+            this.useUnicodeExtraFields = useUnicodeExtraFields;
+            return asThis();
+        }
+
+        protected boolean isUseUnicodeExtraFields() {
+            return useUnicodeExtraFields;
+        }
+
+        /**
+         * Controls whether the stream attempts to read STORED entries that 
use a data descriptor.
+         *
+         * <p>If set to {@code true}, the stream will not stop reading an 
entry at the
+         * declared compressed size. Instead, it will continue until a data 
descriptor
+         * is encountered (by detecting the Data Descriptor Signature). This 
may cause
+         * issues in certain cases, such as JARs embedded in WAR files.</p>
+         *
+         * <p>See <a 
href="https://issues.apache.org/jira/browse/COMPRESS-555";>COMPRESS-555</a>
+         * for details.</p>
+         *
+         * <p>This feature is disabled by default.</p>
+         *
+         * @param allowStoredEntriesWithDataDescriptor {@code true} to read 
STORED entries with data descriptors,
+         *                                             {@code false} to stop 
at the compressed size.
+         * @return this

Review Comment:
   Fixed in 
https://github.com/apache/commons-compress/pull/706/commits/8cf58ad7cb397857b5fc9d5fd172af692e1ce7c4



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to