ASF Bugzilla – Attachment 36479 Details for
Bug 63248
[PATCH] FTP action "feat" support
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
patch
patch.txt (text/plain), 3.31 KB, created by
Eugène Adell
on 2019-03-08 21:19:28 UTC
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Eugène Adell
Created:
2019-03-08 21:19:28 UTC
Size:
3.31 KB
patch
obsolete
>diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java b/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java >index aa69cf7..ed41e04 100644 >--- a/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java >+++ b/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java >@@ -88,6 +88,7 @@ public class FTP extends Task implements FTPTaskConfig { > protected static final int CHMOD = 5; > protected static final int RM_DIR = 6; > protected static final int SITE_CMD = 7; >+ protected static final int FEAT = 8; > /** return code of ftp */ > private static final int CODE_521 = 521; > private static final int CODE_550 = 550; >@@ -2115,6 +2116,30 @@ public class FTP extends Task implements FTPTaskConfig { > } > > /** >+ * Sends the feat command to the ftp server >+ * @param ftp ftp client >+ * @throws IOException in unknown circumstances >+ * @throws BuildException in unknown circumstances >+ */ >+ protected void doFeatCommand(FTPClient ftp) >+ throws IOException, BuildException { >+ >+ log("Doing Feat Command: ", Project.MSG_VERBOSE); >+ >+ // use commons-net 1.4 compatible syntax although there >+ // are alternatives for newer versions >+ if (ftp.sendCommand("FEAT") != 211) { >+ log("Failed to issue Feat Command: ", Project.MSG_WARN); >+ } else { >+ for (String reply : ftp.getReplyStrings()) { >+ if (reply != null && !reply.contains("211")) { >+ log(reply, Project.MSG_WARN); >+ } >+ } >+ } >+ } >+ >+ /** > * Sends a single file to the remote host. <code>filename</code> may > * contain a relative path specification. When this is the case, <code>sendFile</code> > * will attempt to create any necessary parent directories before sending >@@ -2503,6 +2528,11 @@ public class FTP extends Task implements FTPTaskConfig { > executeRetryable(new RetryHandler(this.retriesAllowed, this), > () -> doSiteCommand(lftp, FTP.this.siteCommand), > "Site Command: " + this.siteCommand); >+ } else if (action == FEAT) { >+ final FTPClient lftp = ftp; >+ executeRetryable(new RetryHandler(this.retriesAllowed, this), >+ () -> doFeatCommand(lftp), >+ "Feat Command"); > } else { > if (remotedir != null) { > log("changing the remote directory to " + remotedir, >@@ -2541,13 +2571,13 @@ public class FTP extends Task implements FTPTaskConfig { > /** > * an action to perform, one of > * "send", "put", "recv", "get", "del", "delete", "list", "mkdir", "chmod", >- * "rmdir" >+ * "rmdir", "feat" > */ > public static class Action extends EnumeratedAttribute { > > private static final String[] VALID_ACTIONS = { > "send", "put", "recv", "get", "del", "delete", "list", "mkdir", >- "chmod", "rmdir", "site" >+ "chmod", "rmdir", "site", "feat" > }; > > /** >@@ -2586,6 +2616,9 @@ public class FTP extends Task implements FTPTaskConfig { > return RM_DIR; > case "site": > return SITE_CMD; >+ case "feat": >+ return FEAT; >+ > } > return SEND_FILES; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 63248
:
36479
|
36666
|
36767
|
36768