Commons Net
  1. Commons Net
  2. NET-366

FTPClientConfig: setServerLanguageCode and setShortMonthNames do not work

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.2
    • Fix Version/s: 3.0
    • Component/s: FTP
    • Labels:
      None

      Description

      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:

      public UnixFTPEntryParser()
      {
          this(null);
      }
      
      public UnixFTPEntryParser(FTPClientConfig config)
      {
          super(REGEX);
          configure(config);
      }
      

      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

      public FTPFileEntryParser createUnixFTPEntryParser()
      {
          return new UnixFTPEntryParser();
      }
      

      to

      public FTPFileEntryParser createUnixFTPEntryParser()
      {
          return new UnixFTPEntryParser(config);
      }
      

      Then the config object will be passed to UnixFTPEntryParser.

        Activity

        Johannes Katelaan created issue -
        Hide
        Sebb added a comment -

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

        Show
        Sebb added a comment - Thanks. There were other places where the config was not passed on. All have been fixed (hopefully).
        Sebb made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 3.0 [ 12314126 ]
        Resolution Fixed [ 1 ]
        Sebb made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        1h 1 Sebb 09/Mar/11 12:01
        Resolved Resolved Closed Closed
        87d 7h 24m 1 Sebb 04/Jun/11 20:26

          People

          • Assignee:
            Unassigned
            Reporter:
            Johannes Katelaan
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development