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
HONMA Hirotaka made changes - 25/Feb/08 10:27 AM
Field Original Value New Value
Description 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:

{code}
[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
{code}

test code:

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

results bellow.

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

Second element(bbb.txt) should not be null.
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:

{code}
[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
{code}

test code:

{code}
public void testCommonsNetLeapDay() throws Exception {
    final FTPClient ftp = new FTPClient();
    ftp.addProtocolCommandListener(new LoggingCommandListener());
    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();
}
{code}

results bellow.

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

Second element(bbb.txt) should not be null.
HONMA Hirotaka made changes - 25/Feb/08 10:28 AM
Description 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:

{code}
[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
{code}

test code:

{code}
public void testCommonsNetLeapDay() throws Exception {
    final FTPClient ftp = new FTPClient();
    ftp.addProtocolCommandListener(new LoggingCommandListener());
    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();
}
{code}

results bellow.

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

Second element(bbb.txt) should not be null.
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:

{code}
[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
{code}

test code:

{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();
}
{code}

results bellow.

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

Second element(bbb.txt) should not be null.
Ingo Weinhold made changes - 29/Feb/08 04:10 PM
Attachment commons-net-ftp-date-parser-feb29.patch [ 12376838 ]
Mauricio Hiroshi Nagaoka made changes - 29/Feb/08 05:35 PM
Comment [ Don't you guys think the proposed fix has a problem if the file date is, let's say, Dec 25? It will assume Dec 25 2008 instead of Dec 25 2007. ]
Sebb made changes - 01/Mar/08 03:16 PM
Link This issue is duplicated by NET-190 [ NET-190 ]
Sebb made changes - 01/Mar/08 03:17 PM
Link This issue is duplicated by NET-191 [ NET-191 ]
Sebb made changes - 01/Mar/08 03:18 PM
Comment [ See also NET-190 and NET-191 which were closed as duplicates of this

[Comment Added because JIRA does not seem to keep track of duplicates ...] ]
Brian Phillips made changes - 03/Mar/08 12:48 PM
Attachment DstParseTest.java [ 12376974 ]
Sebb made changes - 03/Mar/08 01:39 PM
Link This issue relates to VFS-201 [ VFS-201 ]
Sebb made changes - 04/Mar/08 02:22 AM
Link This issue is duplicated by NET-193 [ NET-193 ]
Sebb made changes - 04/Mar/08 08:48 PM
Attachment UnixParseLeapTest.patch [ 12377119 ]
Sebb made changes - 08/Mar/08 10:14 AM
Link This issue is blocked by NET-198 [ NET-198 ]
Rory Winston made changes - 08/Mar/08 07:21 PM
Link This issue is duplicated by NET-199 [ NET-199 ]
Sebb made changes - 09/Mar/08 10:43 PM
Link This issue is related to NET-83 [ NET-83 ]
Sebb made changes - 12/Mar/08 08:19 PM
Attachment FTPTimestampParserLeap.patch [ 12377727 ]
Sebb made changes - 12/Mar/08 08:20 PM
Attachment UnixParseLeapTest.patch [ 12377119 ]
Sebb made changes - 15/Mar/08 02:20 AM
Link This issue is related to NET-205 [ NET-205 ]
Martin Oberhuber made changes - 16/Mar/08 12:56 PM
Attachment jan01.patch [ 12377995 ]
Sebb made changes - 07/Apr/08 01:37 AM
Link This issue relates to NET-211 [ NET-211 ]
Sebb made changes - 07/Apr/08 01:45 AM
Link This issue is related to NET-212 [ NET-212 ]
Andre Sudhoff made changes - 13/May/08 04:58 PM
Attachment FTPTimestampParserImpl.patch [ 12381969 ]
Rory Winston made changes - 15/May/08 10:02 PM
Resolution Fixed [ 1 ]
Fix Version/s 2.0 [ 12312040 ]
Fix Version/s 1.5 [ 12312041 ]
Status Open [ 1 ] Closed [ 6 ]
Sebb made changes - 25/Jun/08 10:50 AM
Link This issue is duplicated by NET-209 [ NET-209 ]
Niall Pemberton made changes - 26/Jun/08 09:57 AM
Link This issue is duplicated by NET-224 [ NET-224 ]