This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-net.git
commit 7046ea5f9a411088f94ef593c92ea3386e4bb641 Author: Gary D. Gregory <garydgreg...@gmail.com> AuthorDate: Sun Feb 16 09:53:13 2025 -0500 Javadoc - Remove old private comment - Less vertical whitespace --- src/main/java/org/apache/commons/net/ftp/FTPClient.java | 3 --- .../org/apache/commons/net/io/CopyStreamListener.java | 15 +++++++-------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/main/java/org/apache/commons/net/ftp/FTPClient.java b/src/main/java/org/apache/commons/net/ftp/FTPClient.java index 7e0763d0..d96fb299 100644 --- a/src/main/java/org/apache/commons/net/ftp/FTPClient.java +++ b/src/main/java/org/apache/commons/net/ftp/FTPClient.java @@ -267,7 +267,6 @@ import org.apache.commons.net.util.NetConstants; */ public class FTPClient extends FTP implements Configurable { - // @since 3.0 private static final class CSL implements CopyStreamListener { private final FTPClient parent; @@ -910,11 +909,9 @@ public class FTPClient extends FTP implements Configurable { } else { input = getBufferedInputStream(socket.getInputStream()); } - if (DurationUtils.isPositive(controlKeepAliveTimeout)) { csl = new CSL(this, controlKeepAliveTimeout, controlKeepAliveReplyTimeout); } - // Treat everything else as binary for now Util.copyStream(input, local, getBufferSize(), CopyStreamEvent.UNKNOWN_STREAM_SIZE, mergeListeners(csl), false); } finally { diff --git a/src/main/java/org/apache/commons/net/io/CopyStreamListener.java b/src/main/java/org/apache/commons/net/io/CopyStreamListener.java index b139a501..8dd9e1c4 100644 --- a/src/main/java/org/apache/commons/net/io/CopyStreamListener.java +++ b/src/main/java/org/apache/commons/net/io/CopyStreamListener.java @@ -14,17 +14,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.apache.commons.net.io; import java.util.EventListener; /** - * The CopyStreamListener class can accept CopyStreamEvents to keep track of the progress of a stream copying operation. However, it is currently not used that - * way within NetComponents for performance reasons. Rather the bytesTransferred(long, int) method is called directly rather than passing an event to - * bytesTransferred(CopyStreamEvent), saving the creation of a CopyStreamEvent instance. Also, the only place where CopyStreamListener is currently used within - * NetComponents is in the static methods of the uninstantiable org.apache.commons.io.Util class, which would preclude the use of addCopyStreamListener and - * removeCopyStreamListener methods. However, future additions may use the JavaBean event model, which is why the hooks have been included from the beginning. + * Accepts {@link CopyStreamEvent}s to track the progress of a stream copying operation. However, it is currently not used that way within Net for performance + * reasons. Rather, the bytesTransferred(long, int) method is called directly rather than passing an event to bytesTransferred(CopyStreamEvent), saving the + * creation of a CopyStreamEvent instance. Also, the only place where CopyStreamListener is currently used within Net is in the static methods of the + * uninstantiable org.apache.commons.io.Util class, which would preclude the use of addCopyStreamListener and removeCopyStreamListener methods. However, future + * additions may use the JavaBean event model, which is why the hooks have been included from the beginning. * * * @see CopyStreamEvent @@ -33,8 +32,8 @@ import java.util.EventListener; */ public interface CopyStreamListener extends EventListener { /** - * This method is invoked by a CopyStreamEvent source after copying a block of bytes from a stream. The CopyStreamEvent will contain the total number of - * bytes transferred so far and the number of bytes transferred in the last write. + * Accepts a source event after copying a block of bytes from a stream. The CopyStreamEvent will contain the total number of bytes transferred so far and + * the number of bytes transferred in the last write. * * @param event The CopyStreamEvent fired by the copying of a block of bytes. */