You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2023/06/23 12:49:54 UTC
[commons-net] branch master updated (496d6b94 -> ba6a779d)
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/commons-net.git
from 496d6b94 Remove underscores from instance variable names
new 62293ea5 Format tweak.
new 161813f8 Javadoc
new ba6a779d TFTPServer setter methods now throws IllegalArgumentException instead of RuntimeException
The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
src/main/java/org/apache/commons/net/DatagramSocketClient.java | 2 +-
src/test/java/org/apache/commons/net/tftp/TFTPServer.java | 8 +++++---
2 files changed, 6 insertions(+), 4 deletions(-)
[commons-net] 03/03: TFTPServer setter methods now throws IllegalArgumentException instead of RuntimeException
Posted by gg...@apache.org.
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 ba6a779dd4800676a63675248dcbecef87997857
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Fri Jun 23 08:49:50 2023 -0400
TFTPServer setter methods now throws IllegalArgumentException instead of
RuntimeException
- TFTPServer.setMaxTimeoutRetries() now throws IllegalArgumentException
instead of RuntimeException.
- TFTPServer.setSocketTimeout() now throws IllegalArgumentException
instead of RuntimeException.
- Javadoc
---
src/test/java/org/apache/commons/net/tftp/TFTPServer.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/test/java/org/apache/commons/net/tftp/TFTPServer.java b/src/test/java/org/apache/commons/net/tftp/TFTPServer.java
index 30ca4d82..a593713f 100644
--- a/src/test/java/org/apache/commons/net/tftp/TFTPServer.java
+++ b/src/test/java/org/apache/commons/net/tftp/TFTPServer.java
@@ -723,10 +723,11 @@ public class TFTPServer implements Runnable {
* Set the max number of retries in response to a timeout. Default 3. Min 0.
*
* @param retries number of retries, must be > 0
+ * @throws IllegalArgumentException if {@code retries} is less than 0.
*/
public void setMaxTimeoutRetries(final int retries) {
if (retries < 0) {
- throw new RuntimeException("Invalid Value");
+ throw new IllegalArgumentException("Invalid Value");
}
maxTimeoutRetries = retries;
}
@@ -737,10 +738,11 @@ public class TFTPServer implements Runnable {
* Defaults to the value {@link TFTP#DEFAULT_TIMEOUT}. Minimum value of 10.
* </p>
* @param timeout the timeout; must be equal to or larger than 10.
+ * @throws IllegalArgumentException if {@code timeout} is less than 10.
*/
public void setSocketTimeout(final int timeout) {
if (timeout < 10) {
- throw new RuntimeException("Invalid Value");
+ throw new IllegalArgumentException("Invalid Value");
}
socketTimeout = timeout;
}
[commons-net] 02/03: Javadoc
Posted by gg...@apache.org.
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 161813f859e40ddcd1db1b928fa4f45ae02eaeed
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Fri Jun 23 08:42:45 2023 -0400
Javadoc
---
src/main/java/org/apache/commons/net/DatagramSocketClient.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/java/org/apache/commons/net/DatagramSocketClient.java b/src/main/java/org/apache/commons/net/DatagramSocketClient.java
index bbb9db5b..2280f3a7 100644
--- a/src/main/java/org/apache/commons/net/DatagramSocketClient.java
+++ b/src/main/java/org/apache/commons/net/DatagramSocketClient.java
@@ -229,7 +229,7 @@ public abstract class DatagramSocketClient {
* method should be used prior to a call to {@link #open open()} and should not be confused with {@link #setSoTimeout setSoTimeout()} which operates on the
* currently open socket. _timeout_ contains the new timeout value.
*
- * @param timeout The timeout in milliseconds to use for the datagram socket connection.
+ * @param timeout The timeout durations to use for the datagram socket connection.
*/
public void setDefaultTimeout(final Duration timeout) {
_timeout_ = Math.toIntExact(timeout.toMillis());
[commons-net] 01/03: Format tweak.
Posted by gg...@apache.org.
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 62293ea5fdc1ffed3682b187f2818ff497ec6dea
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Fri Jun 23 08:42:02 2023 -0400
Format tweak.
---
src/test/java/org/apache/commons/net/tftp/TFTPServer.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/test/java/org/apache/commons/net/tftp/TFTPServer.java b/src/test/java/org/apache/commons/net/tftp/TFTPServer.java
index f387a93c..30ca4d82 100644
--- a/src/test/java/org/apache/commons/net/tftp/TFTPServer.java
+++ b/src/test/java/org/apache/commons/net/tftp/TFTPServer.java
@@ -77,8 +77,8 @@ import org.apache.commons.net.io.ToNetASCIIInputStream;
*
* @since 2.0
*/
-
public class TFTPServer implements Runnable {
+
public enum ServerMode {
GET_ONLY, PUT_ONLY, GET_AND_PUT
}