You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2004/04/15 11:39:04 UTC

DO NOT REPLY [Bug 28406] New: - ftp.parser.NTFTPEntryParser doesn't recognize numerical named directory

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=28406>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=28406

ftp.parser.NTFTPEntryParser doesn't recognize numerical named directory

           Summary: ftp.parser.NTFTPEntryParser doesn't recognize numerical
                    named directory
           Product: Commons
           Version: 1.1.0
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Net
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: cpp@vip.163.com


On Windows2k's built-in FTP server, FtpClient.listFiles() doesn't list 
numerical named directories like '1994'.

Here is a quick fix:

--- NTFTPEntryParser.java.orig	Thu Oct 23 10:13:00 2003
+++ NTFTPEntryParser.java	Thu Apr 15 17:23:58 2004
@@ -162,7 +162,7 @@
             {
                 return (null);
             }
-            f.setName(name);
+
             //convert all the calendar stuff to ints
             int month = new Integer(mo).intValue() - 1;
             int day = new Integer(da).intValue();
@@ -198,6 +198,14 @@
             {
                 f.setType(FTPFile.DIRECTORY_TYPE);
                 f.setSize(0);
+                if (null != size)
+                {
+                    f.setName(size+name);
+                }
+                else
+                {
+                    f.setName(name);
+                }    
             }
             else
             {
@@ -206,6 +214,7 @@
                 {
                     f.setSize(new Integer(size).intValue());
                 }
+                f.setName(name);
             }
             return (f);
         }

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org