Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-4444

Wrong slash in FTP component for doneFile

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.8.0
    • 2.8.2, 2.9.0
    • camel-ftp
    • None
    • Unknown

    Description

      I tried to use the doneFile with FTP component.
      When I used it to my FTP on my windows machine everything goes fine.
      When I tried to act the same with a FTP host on a Linux machine, I got an issue.

      I sniff the packet to see what goes wrong and I see this :
      the doneFile
      DELE public/Test/in\myFile.txt
      the file to process
      DELE public/Test/in/myFile.xml

      After a Quick look on the code:
      org.apache.camel.component.file.GenericFileEndpoint
      line 682

      String answer = pattern;
      if (ObjectHelper.isNotEmpty(path) && ObjectHelper.isNotEmpty(pattern))

      { // done file must always be in same directory as the real file name answer = path + File.separator + pattern; }

      if (getConfiguration().needToNormalize())

      { // must normalize path to cater for Windows and other OS answer = FileUtil.normalizePath(answer); }

      We use the "File.Separator" but in this case, it should get a kind of "FTP.Separator" or the FTP component should return true to the needToNormalize method and change the narmalizePath method to manage this case.

      Attachments

        1. CAMEL-4444.patch
          0.7 kB
          Olivier Cheslet
        2. CAMEL-4444.patch
          0.7 kB
          Olivier Cheslet

        Activity

          People

            davsclaus Claus Ibsen
            oliches Olivier Cheslet
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: