You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2012/07/14 15:22:09 UTC

svn commit: r1361541 - in /commons/proper/net/trunk/src: changes/changes.xml main/java/org/apache/commons/net/ftp/FTPClient.java

Author: sebb
Date: Sat Jul 14 13:22:08 2012
New Revision: 1361541

URL: http://svn.apache.org/viewvc?rev=1361541&view=rev
Log:
NET-449 listFiles bug with folder that begins with "-". Clarify Javadoc.

Modified:
    commons/proper/net/trunk/src/changes/changes.xml
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.java

Modified: commons/proper/net/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/changes/changes.xml?rev=1361541&r1=1361540&r2=1361541&view=diff
==============================================================================
--- commons/proper/net/trunk/src/changes/changes.xml (original)
+++ commons/proper/net/trunk/src/changes/changes.xml Sat Jul 14 13:22:08 2012
@@ -65,6 +65,9 @@ The <action> type attribute can be add,u
         <release version="3.2" date="TBA" description="
 TBA
         ">
+            <action issue="NET-449" dev="sebb" type="fix">
+            listFiles bug with folder that begins with "-". Clarify Javadoc.
+            </action>
             <action issue="NET-473" dev="sebb" type="fix">
             FTPClient setSoTimeout (int time) will result in NullPointerException. Clarify Javadoc.
             </action>

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.java?rev=1361541&r1=1361540&r2=1361541&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.java Sat Jul 14 13:22:08 2012
@@ -2692,6 +2692,11 @@ implements Configurable
      * expand glob expressions.
      * <p>
      * @param pathname  The file or directory to list.
+     *                  Warning: the server may treat a leading '-' as an
+     *                  option introducer. If so, try using an absolute path,
+     *                  or prefix the path with ./ (unix style servers).
+     *                  Some servers may support "--" as meaning end of options,
+     *                  in which case "-- -xyz" should work.
      * @return The list of filenames contained in the given path.  null if
      *     the list could not be obtained.  If there are no filenames in
      *     the directory, a zero-length array is returned.
@@ -2774,6 +2779,11 @@ implements Configurable
      *                  or may not expand glob expressions, using them here
      *                  is not recommended and may well cause this method to
      *                  fail.
+     *                  Also, some servers treat a leading '-' as being an option.
+     *                  To avoid this interpretation, use an absolute pathname
+     *                  or prefix the pathname with ./ (unix style servers).
+     *                  Some servers may support "--" as meaning end of options,
+     *                  in which case "-- -xyz" should work.
      *
      * @return The list of file information contained in the given path in
      *         the format determined by the autodetection mechanism