Issue Details (XML | Word | Printable)

Key: NET-188
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: HONMA Hirotaka
Votes: 32
Watchers: 28
Operations

If you were logged in you would be able to see more operations.
Commons Net

FTPClient#listFiles returns null element when file's timestamp is "02/29"

Created: 25/Feb/08 10:22 AM   Updated: 26/Jun/08 09:57 AM
Return to search
Component/s: None
Affects Version/s: 1.4
Fix Version/s: 2.0, 1.5

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works commons-net-ftp-date-parser-feb29.patch 2008-02-29 04:10 PM Ingo Weinhold 1 kB
Java Source File DstParseTest.java 2008-03-03 12:48 PM Brian Phillips 0.5 kB
Text File Licensed for inclusion in ASF works FTPTimestampParserImpl.patch 2008-05-13 04:58 PM Andre Sudhoff 5 kB
Text File Licensed for inclusion in ASF works FTPTimestampParserLeap.patch 2008-03-12 08:19 PM Sebb 4 kB
Text File Licensed for inclusion in ASF works jan01.patch 2008-03-16 12:56 PM Martin Oberhuber 0.7 kB
Issue Links:
Blocker
 
Duplicate
 
Reference

Resolution Date: 15/May/08 10:02 PM


 Description  « Hide
This issue has same cause as VALIDATOR-221.
org.apache.commons.net.ftp.parser.FTPTimestampParserImpl#parseTimestamp throws ParseException with timestampStr = "Feb 29 11:22".

FTP Server status:

[root@localhost test-commonsnet]# pwd
/tmp/test-commonsnet
[root@localhost test-commonsnet]# ls -l
total 0
-rw-r--r--  1 root root 0 Dec 19  2006 aaa.txt
-rw-r--r--  1 root root 0 Feb 29 11:22 bbb.txt

test code:

public void testCommonsNetLeapDay() throws Exception {
    final FTPClient ftp = new FTPClient();
    ftp.connect(host);
    ftp.login(user, password);
    final FTPFile[] listFiles = ftp.listFiles("/tmp/test-commonsnet");
    for (int i = 0; i < listFiles.length; i++) {
        System.out.println("[" + i + "] " + listFiles[i]);
    }
    ftp.disconnect();
}

results bellow.

[0] -rw-r--r--    1 0        0               0 Dec 18  2006 aaa.txt
[1] null

Second element(bbb.txt) should not be null.



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Repository Revision Date User Message
ASF #631518 Wed Feb 27 09:16:59 UTC 2008 rwinston Add timezone and date symbols to formatter (NET-188)
Files Changed
MODIFY /commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImpl.java

Repository Revision Date User Message
ASF #632584 Sat Mar 01 12:41:17 UTC 2008 rwinston Add isLeapYear() check (NET-188)
Files Changed
MODIFY /commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImpl.java

Repository Revision Date User Message
ASF #632831 Sun Mar 02 20:29:07 UTC 2008 rwinston NET-188
Files Changed
MODIFY /commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImpl.java

Repository Revision Date User Message
ASF #633380 Tue Mar 04 07:39:17 UTC 2008 rwinston Remove specific isLeapYear() check, to handle other cases (such as Apr 26 02:00 in US/Central timezone). See NET-188
Files Changed
MODIFY /commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImpl.java

Repository Revision Date User Message
ASF #633381 Tue Mar 04 07:40:45 UTC 2008 rwinston Remove specific isLeapYear() check, to handle other cases (such as Apr 26 02:00 in US/Central timezone). See NET-188
Files Changed
MODIFY /commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImpl.java

Repository Revision Date User Message
ASF #645336 Mon Apr 07 00:27:04 UTC 2008 sebb NET-188 - apply patch of 12/Mar/08 01:19 PM; fixes Feb 29 parsing
Files Changed
MODIFY /commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImpl.java

Repository Revision Date User Message
ASF #645528 Mon Apr 07 14:11:03 UTC 2008 sebb NET-188 - remove redundant code
Files Changed
MODIFY /commons/proper/net/trunk/src/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImpl.java