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

Rework of File Component to Remove Tangles and simplify code

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.4.0
    • camel-core
    • None

    Description

      After my first smaller rework in issue camel-262 I now completely reworked the file component to remove any cyclic references and clean up the code.

      The first thing I did was separating the FileComponent from the other classes in package file by moving them to a new package .impl. This way I was able to remove the cycle between the strategy package and the file package.

      The second step was to move all config data from FileEndPoint to a new class FileEndPointConfig. This way I was able to remove the cycle between FileEndPoint, FileProducer and FileConsumer.

      Next I removed FileMessage and FileExchange and instead relied on the default objects. The file is simply stored in DefaultMessage.body. There was even a comment in the code asking if FileExchange was necessary before. So I hope this is ok?

      I had to adapt the tests to the new structure but only changed the tests where it was absolutely necessary. All tests run fine.

      What do you think?

      Attachments

        1. patchfile.txt
          80 kB
          Christian Schneider
        2. patch.txt
          70 kB
          Christian Schneider
        3. old.png
          26 kB
          Christian Schneider
        4. new no tangles.png
          28 kB
          Christian Schneider
        5. file-test.zip
          29 kB
          Christian Schneider
        6. file.zip
          59 kB
          Christian Schneider

        Activity

          People

            hadrian Hadrian Zbarcea
            cschneider Christian Schneider
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: