You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Lukas Vlcek <lu...@gmail.com> on 2006/07/31 14:12:25 UTC

[Net] FTPFile.getTimestamp() returns incorrect year

Hi, this is forwarded from user list. Does anybody know how to solve
this problem?
Regards,
Lukas

---------- Forwarded message ----------
Hi,

I found that FTPFile.getTimestamp() returns incorrect year.
I have a file which was created on 2006-07-28 but getTimestamp()
method returns 2005-07-28.
Does anybody know any workaround?
Is there fixed version available yet?

Thanks,
Lukas

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


Re: [Net] FTPFile.getTimestamp() returns incorrect year

Posted by Lukas Vlcek <lu...@gmail.com>.
Hi,

Let's elaborate this questions a little more. When I do the follwoing
then it works as expected:

#1) ==================
Calendar cal = null;
FTPTimestampParserImpl parser = new FTPTimestampParserImpl();
parser.configure(UnixFTPEntryParser.NUMERIC_DATE_CONFIG);
try {
	cal = parser.parseTimestamp("2006-07-03 22:52");
} catch (Throwable e) {
	fail(e.getMessage());
}
System.out.println(cal.getTime());

Now the question is if this is exactly the same what will happen
behind the scene if I do the following:

#2) ==================
FTPClient client = new
FTPClient();	client.configure(UnixFTPEntryParser.NUMERIC_DATE_CONFIG);
FTPFile[] allFiles = client.listFiles(folder);

Because not the particualr FTPFiles.getTimestamp() would lead to 2005
year instead of 2006. Do I need to perform additional configuration
setting in the second case?

Regards,
Lukas

On 7/31/06, Lukas Vlcek <lu...@gmail.com> wrote:
> Hi, this is forwarded from user list. Does anybody know how to solve
> this problem?
> Regards,
> Lukas
>
> ---------- Forwarded message ----------
> Hi,
>
> I found that FTPFile.getTimestamp() returns incorrect year.
> I have a file which was created on 2006-07-28 but getTimestamp()
> method returns 2005-07-28.
> Does anybody know any workaround?
> Is there fixed version available yet?
>
> Thanks,
> Lukas
>

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