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


##########
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:
   @garydgregory 
   This is because the super method is declared as `protected` and is therefore 
inaccessible within the `ZipArchiveOutputStream` constructor. Overriding it 
(without changing the access modifiers) makes it accessible there.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to