commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1649833 - /commons/proper/net/trunk/src/main/java/examples/ftp/FTPClientExample.java
Date Tue, 06 Jan 2015 15:34:44 GMT
Author: sebb
Date: Tue Jan  6 15:34:44 2015
New Revision: 1649833

URL: http://svn.apache.org/r1649833
Log:
Improved error reporting

Modified:
    commons/proper/net/trunk/src/main/java/examples/ftp/FTPClientExample.java

Modified: commons/proper/net/trunk/src/main/java/examples/ftp/FTPClientExample.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/examples/ftp/FTPClientExample.java?rev=1649833&r1=1649832&r2=1649833&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/examples/ftp/FTPClientExample.java (original)
+++ commons/proper/net/trunk/src/main/java/examples/ftp/FTPClientExample.java Tue Jan  6 15:34:44
2015
@@ -25,6 +25,7 @@ import java.io.OutputStream;
 import java.io.PrintWriter;
 import java.net.InetAddress;
 import java.net.UnknownHostException;
+import java.util.Arrays;
 
 import org.apache.commons.net.PrintCommandListener;
 import org.apache.commons.net.ftp.FTP;
@@ -51,7 +52,7 @@ public final class FTPClientExample
 {
 
     public static final String USAGE =
-        "Usage: ftp [options] <hostname> <username> <password> [<remote
file> [<local file>]]\n" +
+        "Expected Parameters: [options] <hostname> <username> <password>
[<remote file> [<local file>]]\n" +
         "\nDefault behavior is to download a file and use ASCII transfer mode.\n" +
         "\t-a - use local active mode (default is local passive)\n" +
         "\t-A - anonymous login (omit username and password parameters)\n" +
@@ -214,6 +215,9 @@ public final class FTPClientExample
         }
         if (remain < minParams) // server, user, pass, remote, local [protocol]
         {
+            if (args.length > 0) {
+                System.err.println("Actual Parameters: " + Arrays.toString(args));
+            }
             System.err.println(USAGE);
             System.exit(1);
         }



Mime
View raw message