commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Johannes Katelaan (JIRA)" <j...@apache.org>
Subject [jira] Created: (NET-366) FTPClientConfig: setServerLanguageCode and setShortMonthNames do not work
Date Wed, 09 Mar 2011 11:02:00 GMT
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


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

Mime
View raw message