commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <j...@apache.org>
Subject [jira] Issue Comment Edited: (NET-188) FTPClient#listFiles returns null element when file's timestamp is "02/29"
Date Mon, 10 Mar 2008 00:43:46 GMT

    [ https://issues.apache.org/jira/browse/NET-188?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12576830#action_12576830
] 

sebb@apache.org edited comment on NET-188 at 3/9/08 5:42 PM:
--------------------------------------------------

This is related to NET-83, which describes another instance where the FTP directory listing
does not show the year.
Note that FreeBSD shows past and future dates without the year if the date is within 6 months
of the current date, for example:

{code}
-rw-r--r--  1 user Domain Users  0 Sep  9  2007 200709091234.tmp
-rw-r--r--  1 user Domain Users  0 Sep 10 12:34 200709101234.tmp

-rw-r--r--  1 user Domain Users  0 Sep  7 12:34 200809071234.tmp
-rw-r--r--  1 user Domain Users  0 Sep  8  2008 200809081234.tmp

Sun Mar  9 15:05:09 EDT 2008 # date when listing was obtained
{code}

The file names show the actual timestamp used to "touch" the files.

Looks like the interval that is used is 26 weeks.
Provided that the client and server clocks are not adrift by more than a day, this should
mean that a short date is never ambiguous.

      was (Author: sebb@apache.org):
    This is related to NET-83, which describes another instance where the FTP directory listing
does not show the year.
Note that FreeBSD shows past and future dates without the year if the date is within 6 months
of the current date, for example:

{code}
-rw-r--r--  1 user Domain Users  0 Sep  9  2007 200709091234.tmp
-rw-r--r--  1 user Domain Users  0 Sep 10 12:34 200709101234.tmp

-rw-r--r--  1 user Domain Users  0 Sep  7 12:34 200809071234.tmp
-rw-r--r--  1 user Domain Users  0 Sep  8  2008 200809081234.tmp

Sun Mar  9 15:05:09 EDT 2008 # date when listing was obtained
{code}

The file names show the actual timestamp used to "touch" the files.
  
> FTPClient#listFiles returns null element when file's timestamp is "02/29"
> -------------------------------------------------------------------------
>
>                 Key: NET-188
>                 URL: https://issues.apache.org/jira/browse/NET-188
>             Project: Commons Net
>          Issue Type: Bug
>    Affects Versions: 1.4
>            Reporter: HONMA Hirotaka
>         Attachments: commons-net-ftp-date-parser-feb29.patch, DstParseTest.java, UnixParseLeapTest.patch
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message