Announcement Announcement Module
Collapse
No announcement yet.
FTP Adapter (initiateListParsing) Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • FTP Adapter (initiateListParsing)

    Hi

    I have a problem with the FtpSource since it doesn't allow me to call the method initiateListParsing on the FtpClient. I need my own ConfigurableFTPFileEntryParserImpl as my FTP server shows the file listing with a Danish date format (this can't be changed).

    I have tried to extend the FtpSource to set up my own FtpClient, but since the FtpClient in FtpSource is private final it can't be changed.

    The only way I can think of to solve this problem is to override the FtpSource class completely, but I don't feel this is the right way to do it.

    I have tried working with both the FtpSource of milestone 4 and the latest from svn, but I end up having the same problem.

    Does anyone have any ideas on how to make a workaround on this problem?

  • #2
    Hi,

    For now, this is a limitation, but please follow on:

    http://jira.springframework.org/browse/INT-293.

    The goal is to allow the better configuration of the underlying FtpClient components.

    Regards,
    Marius

    Comment


    • #3
      Originally posted by smor View Post
      Hi
      The only way I can think of to solve this problem is to override the FtpSource class completely, but I don't feel this is the right way to do it.
      [...]
      Does anyone have any ideas on how to make a workaround on this problem?
      You and Liskov share that feeling, mate!

      The thing to do is implement your own Source. You can see if you can reuse code from our FtpSource, or do it your way completely. Then if we come up with an FtpSource that is good enough it will be trivial to swap the source in your configuration. You could probably start with extending AbstractDirectorySource that contains the basic strategies common to reading from directories.

      Comment


      • #4
        The latest changes to FtpSource allow you to inject your own FTPClient. If you call configure on that client (e.g. using a FactoryBean or postprocessing), you could set your ConfigurableFTPFileEntryParserImpl on the client before it connects.

        Will this be sufficient for you, or do you need other hooks?

        Comment


        • #5
          Hi all

          After a long summer vacation - I'm back However I didn't have time to fully revisit the problem - but my first solution was to make my own copy of FTPSource and then implement what I needed.

          This works fine - but with the latest changes in milestone 5, I had to re-implement my FTPSource. Which wasn't a problem.

          The solution with injecting my own FtpClient is exactly what I'm looking for. I just didn't have time to check this out.

          Comment


          • #6
            The next cleanup action will be to allow you to inject an FTPClientFactory, like with FTPTarget. This will allow you to preconfigure the connection before you hand it over to the source (so you could set some modes etc). With the next milestone you could configure instead of reimplement, this will save you some time I guess. Just drop in a Jira issue if something is missing.

            Comment

            Working...
            X