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 2021/02/08 18:24:48 UTC
[commons-net] 03/03: Add FTPClient.hasFeature(FTPCmd).
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch release
in repository https://gitbox.apache.org/repos/asf/commons-net.git
commit 2393a55791dda1b0d38a1950aad276ff7703cc6e
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Feb 8 13:24:40 2021 -0500
Add FTPClient.hasFeature(FTPCmd).
---
src/changes/changes.xml | 17 +++++++++++------
src/main/java/org/apache/commons/net/ftp/FTPClient.java | 16 ++++++++--------
2 files changed, 19 insertions(+), 14 deletions(-)
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index cde7a70..2d908e9 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -64,6 +64,17 @@ The <action> type attribute can be add,update,fix,remove.
<body>
<release version="3.8.0" date="2020-MM-DD" description="Maintenance and bug fix release (Java 7).">
+ <!-- ADD -->
+ <action type="update" dev="ggregory" due-to="Arturo Bernal, Gary Gregory">
+ Add and use NetConstants.
+ </action>
+ <action type="update" dev="ggregory" due-to="Gary Gregory">
+ Add and use SocketClient.applySocketAttributes().
+ </action>
+ <action type="update" dev="ggregory" due-to="Dependabot">
+ Add FTPClient.hasFeature(FTPCmd).
+ </action>
+ <!-- UPDATE -->
<action type="update" dev="ggregory" due-to="Dependabot">
Bump actions/checkout from v2.3.3 to v2.3.4 #69.
</action>
@@ -76,12 +87,6 @@ The <action> type attribute can be add,update,fix,remove.
<action type="update" dev="ggregory" due-to="Arturo Bernal, Gary Gregory">
Minor Improvements #71, #72.
</action>
- <action type="update" dev="ggregory" due-to="Arturo Bernal, Gary Gregory">
- Add and use NetConstants.
- </action>
- <action type="update" dev="ggregory" due-to="Gary Gregory">
- Add and use SocketClient.applySocketAttributes().
- </action>
</release>
<release version="3.7.2" date="2020-10-14" description="Maintenance and bug fix release (Java 7).">
<action issue="NET-689" type="fix" dev="ggregory" due-to="Charlie, Gary Gregory">
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 3e4b027..907411d 100644
--- a/src/main/java/org/apache/commons/net/ftp/FTPClient.java
+++ b/src/main/java/org/apache/commons/net/ftp/FTPClient.java
@@ -473,15 +473,15 @@ public class FTPClient extends FTP implements Configurable {
* transfer.
*/
public static final int PASSIVE_REMOTE_DATA_CONNECTION_MODE = 3;
-
+
/** Pattern for PASV mode responses. Groups: (n,n,n,n),(n),(n) */
private static final java.util.regex.Pattern PARMS_PAT;
-
+
static {
PARMS_PAT = java.util.regex.Pattern.compile(
"(\\d{1,3},\\d{1,3},\\d{1,3},\\d{1,3}),(\\d{1,3}),(\\d{1,3})");
}
-
+
private static Properties getOverrideProperties() {
return PropertiesSingleton.PROPERTIES;
}
@@ -534,7 +534,7 @@ public class FTPClient extends FTP implements Configurable {
// malformed reply, return all after reply code and space
return param;
}
-
+
private int dataConnectionMode;
private int dataTimeoutMillis;
@@ -544,10 +544,10 @@ public class FTPClient extends FTP implements Configurable {
private int activeMinPort;
private int activeMaxPort;
private InetAddress activeExternalHost;
-
+
/** overrides __activeExternalHost in EPRT/PORT commands. */
private InetAddress reportActiveExternalHost;
-
+
/** The address to bind to on passive connections, if necessary. */
private InetAddress passiveLocalHost;
private int fileType;
@@ -2211,11 +2211,11 @@ public class FTPClient extends FTP implements Configurable {
for (final String line : _replyLines) {
if (line.startsWith(" ")) { // it's a FEAT entry
String key;
- String value="";
+ String value = "";
final int varsep = line.indexOf(' ', 1);
if (varsep > 0) {
key = line.substring(1, varsep);
- value = line.substring(varsep+1);
+ value = line.substring(varsep + 1);
} else {
key = line.substring(1);
}