Uploaded image for project: 'Commons Net'
  1. Commons Net
  2. NET-722

Javadoc for FtpClient.setControlKeepAliveReplyTimeout(Duration) says timeout is in milliseconds

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Trivial
    • Resolution: Fixed
    • 3.9.0
    • 3.10.0
    • FTP
    • None

    Description

      The JavaDoc comment for FtpClient.setControlKeepAliveReplyTimeout(Duration) is technically incorrect:

       

         /**
           * Sets how long to wait for control keep-alive message replies.
           *
           * @param timeout number of milliseconds to wait (defaults to 1000)
           * @since 3.0
           * @see #setControlKeepAliveTimeout(Duration)
           */
          public void setControlKeepAliveReplyTimeout(final Duration timeout) {
              controlKeepAliveReplyTimeout = DurationUtils.zeroIfNull(timeout);
          } 
      

      The timeout is no longer "number of milliseconds" because it's a Duration and so has the unit embedded within.  The JavaDoc also doesn't document the behavior when null is given.

      Perhaps this something like

      @param timeout amount of time to wait.  This defaults to 1000 milliseconds if not explicitly set.  A value of {@code null} disables the timeout.

      I'm sure you can do better than I can.

      Attachments

        Activity

          People

            Unassigned Unassigned
            david_costanzo David Costanzo
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: