The timestamp information from the FTPFile[] does not consistently return the
Year correctly for the directories being pulled.
------------------------------------------------------------------------------------------------------------------------------
Key: ADDR-23
URL: http://issues.apache.org/jira/browse/ADDR-23
Project: Addressing
Type: Bug
Environment: Platform:Solaris, OS:Unix, Java version:1.4.2_05-b04
Reporter: Seshadri Ranganathan
Here is the issue,
Issue: The timestamp information from the FTPFile[] does not consistently
return the Year correctly for the directories being pulled , it returns 2005
instead of 2006.This does not happen all the time, but happens occasionally. I
take this timestamp and stamp our local client file(s) and directory.
Platform: Solaris
Java version: 1.4.2_05-b04
Jar : commons-net-1.4.1.jar
Code list:
ftp = new FTPClient();
ftp.connect( server );
ftp.login( username, password );
printMe("Connected to " +
server + ".");
printMe(ftp.getReplyString());
// List the files in the directory
String homeDirectoryPublisher = ftp.printWorkingDirectory();
printMe("homeDirectoryPublisher="+homeDirectoryPublisher);
FTPFile[] files = ftp.listFiles();
printMe( "Number of files in dir: " + files.length );
DateFormat df = DateFormat.getDateInstance( DateFormat.SHORT );
for( int i=0; i<files.length; i++ )
{
printMe("----------------Start Dataset Processing file="+(i+1));
Date fileDate = files[ i ].getTimestamp().getTime();
printMe( df.format( files[ i ].getTimestamp().getTime() ) ); // WRONG
DATE PRINTED, instead of YEAR 06 it is printed as 05 ??????????
printMe( "\t" + files[ i ].getName() );
printMe( "\t" + fileDate); // WRONG DATE PRINTED,
instead of YEAR 2006 it is printed as 2005 ??????????
printMe( "\t" + "isDirectory=" + files[ i ].isDirectory());
}
Thanks,
Ranga
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]