You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "garydgregory (via GitHub)" <gi...@apache.org> on 2026/07/11 13:21:47 UTC

Re: [PR] [COMPRESS-722] Introduce handling of entries compressed by a specific method [commons-compress]

garydgregory commented on code in PR #765:
URL: https://github.com/apache/commons-compress/pull/765#discussion_r3564241274


##########
src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java:
##########
@@ -66,6 +71,111 @@
  */
 public class ZipArchiveOutputStream extends ArchiveOutputStream<ZipArchiveEntry> {
 
+    /**
+     * Abstract builder for derived classes of {@link ZipArchiveOutputStream}.
+     *
+     * @param <T> The type of the {@link ZipArchiveOutputStream}.
+     * @param <B> The type of the builder itself.
+     * @since 1.29.0
+     */
+    public abstract static class AbstractBuilder<T extends ZipArchiveOutputStream, B extends AbstractBuilder<T, B>>
+            extends AbstractArchiveBuilder<T, B> {
+
+        /**
+         * Maximum size of a single part of the split archive created by this stream. Must be between 64kB and about 4GB.
+         */
+        protected long zipSplitSize;
+
+        /**
+         * Whether this stream automatically compresses entries using registered compressor factories.
+         */
+        protected boolean autoCompress;
+
+        /**
+         * Constructs a new instance.
+         */
+        protected AbstractBuilder() {
+            setCharset(StandardCharsets.UTF_8);
+        }
+
+        /**
+         * Sets the maximum size of a single part of the split archive created by this stream. Must be between 64kB and about 4GB.
+         *
+         * <p>Zero by default that means there is no splitting.</p>
+         *
+         * @param zipSplitSize the size of a single split part.
+         * @return {@code this} instance.
+         */
+        public B setZipSplitSize(long zipSplitSize) {
+            this.zipSplitSize = zipSplitSize;
+            return asThis();
+        }
+
+        /**
+         * Sets whether this stream automatically compresses entries using registered compressor factories.
+         *
+         * <p>Disabled by default.</p>
+         *
+         * @param autoCompress {@code true} to automatically compress entries, {@code false} otherwise.
+         * @return {@code this} instance.
+         */
+        public B setAutoCompress(final boolean autoCompress) {
+            this.autoCompress = autoCompress;
+            return asThis();
+        }
+
+        @Override

Review Comment:
   @uvoigt 
   Why is this method needed if all it does is call super?
   



-- 
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-unsubscribe@commons.apache.org

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