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/09 13:02:59 UTC

[jira] Resolved: (NET-366) FTPClientConfig: setServerLanguageCode and setShortMonthNames do not work

     [ https://issues.apache.org/jira/browse/NET-366?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sebb resolved NET-366.
----------------------

       Resolution: Fixed
    Fix Version/s: 3.0

Thanks. There were other places where the config was not passed on. All have been fixed (hopefully).

> FTPClientConfig: setServerLanguageCode and setShortMonthNames do not work
> -------------------------------------------------------------------------
>
>                 Key: NET-366
>                 URL: https://issues.apache.org/jira/browse/NET-366
>             Project: Commons Net
>          Issue Type: Bug
>          Components: FTP
>    Affects Versions: 2.2
>            Reporter: Johannes Katelaan
>             Fix For: 3.0
>
>
> The methods {{setServerLanguageCode}} and {{setShortMonthNames}} of {{FTPClientConfig}} do not work.
> The reason for this is, that the config object is not passed to {{ConfigurableFTPFileEntryParserImpl.configure}}.
> The reason for this can be found in class {{UnixFTPEntryParser}}:
> {noformat}
> public UnixFTPEntryParser()
> {
>     this(null);
> }
> public UnixFTPEntryParser(FTPClientConfig config)
> {
>     super(REGEX);
>     configure(config);
> }
> {noformat}
> The contructor {{UnixFTPEntryParser(FTPClientConfig config)}} is never called from outside this class. It is only called once, by the other constructor {{UnixFTPEntryParser()}}.
> Therefore in {{UnixFTPEntryParser(FTPClientConfig config)}} the parameter {{config}} is always null.
> So the settings of {{serverLanguageCode}} and {{shortMonthNames}} will never be passed to {{ConfigurableFTPFileEntryParserImpl.configure}}.
> This can be fixed by changing class {{DefaultFTPFileEntryParserFactory}}.
> Change from
> {noformat}
> public FTPFileEntryParser createUnixFTPEntryParser()
> {
>     return new UnixFTPEntryParser();
> }
> {noformat}
> to
> {noformat}
> public FTPFileEntryParser createUnixFTPEntryParser()
> {
>     return new UnixFTPEntryParser(config);
> }
> {noformat}
> Then the config object will be passed to {{UnixFTPEntryParser}}.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira