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 2025/02/19 20:42:50 UTC
(commons-net) branch master updated: Add FTP.setControlEncoding(Charset)
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
The following commit(s) were added to refs/heads/master by this push:
new 11785fdf Add FTP.setControlEncoding(Charset)
11785fdf is described below
commit 11785fdf4add909d67c1c1a8fa55b2f2dc67df12
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Wed Feb 19 15:42:46 2025 -0500
Add FTP.setControlEncoding(Charset)
Fail-fast in command-line example
---
.../java/org/apache/commons/net/examples/ftp/FTPClientExample.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/main/java/org/apache/commons/net/examples/ftp/FTPClientExample.java b/src/main/java/org/apache/commons/net/examples/ftp/FTPClientExample.java
index b8819991..389b4899 100644
--- a/src/main/java/org/apache/commons/net/examples/ftp/FTPClientExample.java
+++ b/src/main/java/org/apache/commons/net/examples/ftp/FTPClientExample.java
@@ -24,6 +24,7 @@ import java.io.InputStream;
import java.io.OutputStream;
import java.net.InetAddress;
import java.net.UnknownHostException;
+import java.nio.charset.Charset;
import java.time.Duration;
import java.util.Arrays;
@@ -124,7 +125,7 @@ public final class FTPClientExample {
String proxyPassword = null;
String user = null;
String password = null;
- String encoding = null;
+ Charset encoding = null;
String serverTimeZoneId = null;
String displayTimeZoneId = null;
String serverType = null;
@@ -151,7 +152,7 @@ public final class FTPClientExample {
} else if (args[base].equals("-e")) {
useEpsvWithIPv4 = true;
} else if (args[base].equals("-E")) {
- encoding = args[++base];
+ encoding = Charset.forName(args[++base]);
} else if (args[base].equals("-f")) {
feat = true;
minParams = 3;