commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 28406] New: - ftp.parser.NTFTPEntryParser doesn't recognize numerical named directory
Date Thu, 15 Apr 2004 09:39:04 GMT
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


Mime
View raw message