Commons VFS
  1. Commons VFS
  2. VFS-305

[FTP] Support FTP servers with non Latin-1 control encoding

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Labels:
      None
    • Environment:

      Java client talking to Java FTP server (Alfresco)

      Description

      It should be possible to set the client.setControlEncoding with a sensible value.

      Being able to set that value is a must, but a FTPClient (commons-net) that somehow can detect what control encoding is used, would automagically solve a lot of issues. FileZilla automatically detects that Alfresco's FTP server is doing UTF8.

      1. VFS-305(commands).patch
        1 kB
        Dmytro Polivenok
      2. VFS-305.patch
        2 kB
        Dmytro Polivenok

        Issue Links

          Activity

          Hide
          Gary Gregory added a comment -

          Closing as shipped with 2.0.

          Show
          Gary Gregory added a comment - Closing as shipped with 2.0.
          Hide
          Vincent Bonamy added a comment -

          It would be great to reopen this issue : today the bug is not resolved in fact on VFS2 (tag and trunk version).
          I had to apply the last patch given by Dmytro Polivenok (cf his last comment which is very clear, thanks for that) so that it works correctly.
          So please review and apply this patch [attached in this issue with the name "VFS-305(commands).patch" ] so that we can use UTF8 FTP server with VFS2.
          Thanks.

          Show
          Vincent Bonamy added a comment - It would be great to reopen this issue : today the bug is not resolved in fact on VFS2 (tag and trunk version). I had to apply the last patch given by Dmytro Polivenok (cf his last comment which is very clear, thanks for that) so that it works correctly. So please review and apply this patch [attached in this issue with the name "VFS-305(commands).patch" ] so that we can use UTF8 FTP server with VFS2. Thanks.
          Hide
          Dmytro Polivenok added a comment - - edited

          Faced issue related to invoking commands on files with non UTF encoding (create, rename, move, etc..) :
          Commons-net control buffer readers and writers were initialized with DEFAULT_CONTROL_ENCODING = "ISO-8859-1" before setting encoding in FtpClientFactory, so I moved setting control encoding before connect method which creates controlInput,controlOutput in FTP class
          patch - VFS-305(commands).patch

          Show
          Dmytro Polivenok added a comment - - edited Faced issue related to invoking commands on files with non UTF encoding (create, rename, move, etc..) : Commons-net control buffer readers and writers were initialized with DEFAULT_CONTROL_ENCODING = "ISO-8859-1" before setting encoding in FtpClientFactory, so I moved setting control encoding before connect method which creates controlInput , controlOutput in FTP class patch - VFS-305 (commands).patch
          Hide
          Ralph Goers added a comment -

          I reviewed and applied the patch. Please review and close.

          Show
          Ralph Goers added a comment - I reviewed and applied the patch. Please review and close.
          Hide
          Dmytro Polivenok added a comment -

          Attached patch. After applying you will able to set encoding using:
          FtpFileSystemConfigBuilder.getInstance().setControlEncoding(opts, "UTF-8");

          Show
          Dmytro Polivenok added a comment - Attached patch. After applying you will able to set encoding using: FtpFileSystemConfigBuilder.getInstance().setControlEncoding(opts, "UTF-8");

            People

            • Assignee:
              Unassigned
              Reporter:
              Tom
            • Votes:
              2 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development