You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Sebb (JIRA)" <ji...@apache.org> on 2011/03/26 14:41:05 UTC
[jira] [Issue Comment Edited] (NET-331) AS400 file timestamp format
is wrong
[ https://issues.apache.org/jira/browse/NET-331?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13008765#comment-13008765 ]
Sebb edited comment on NET-331 at 3/26/11 1:39 PM:
---------------------------------------------------
Should have realised earlier that the FTPClientConfig.setDefaultDateFormatStr(format) method can be used to override the default format provided by the parser. So for example:
{code}
FTPClient f=FTPClient();
FTPClientConfig conf = new FTPClientConfig(FTPClientConfig.SYST_UNIX);
conf.setDefaultDateFormat("MM/dd/yy HH:mm:ss");
f.configure(conf); // Apply the configuration
{code}
Or the parser could override the preParse() method to scan the raw results and decide which format to use when the main parse is called.
was (Author: sebb@apache.org):
Should have realised earlier that the FTPClientConfig.setDefaultDateFormatStr(format) method can be used to override the default format provided by the parser. So for example:
{code}
FTPClient f=FTPClient();
FTPClientConfig conf = new FTPClientConfig(FTPClientConfig.SYST_UNIX);
conf.setDefaultDateFormat("MM/dd/yy HH:mm:ss");
{code}
Or the parser could override the preParse() method to scan the raw results and decide which format to use when the main parse is called.
> AS400 file timestamp format is wrong
> ------------------------------------
>
> Key: NET-331
> URL: https://issues.apache.org/jira/browse/NET-331
> Project: Commons Net
> Issue Type: Bug
> Components: FTP
> Affects Versions: 2.0
> Environment: AS400
> Reporter: Jim Urban
> Original Estimate: 0h
> Remaining Estimate: 0h
>
> There is a bug in org.apache.commons.net.ftp.parser.OS400FTPEntryParser.java. The variable "private static final String DEFAULT_DATE_FORMAT" needs to be changed from "yy/MM/dd HH:mm:ss"; //01/11/09 12:30:24 to "MM/dd/yy HH:mm:ss"; //01/15/08 14:21:38 to work correctly. I have tested this on our companies AS400 and it solved the problem we were having.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira