Announcement Announcement Module
Collapse
No announcement yet.
Help with Ant-style path pattern for int-file:inbound-channel-adapter file-pattern Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Help with Ant-style path pattern for int-file:inbound-channel-adapter file-pattern

    Hi,

    I want to read files in a directories.

    DIRA/filea.ext
    DIRB/filez.ext
    ...
    DIRZ/file2.ext

    An external application first creates a directory, then writes the file to the directory.

    My ant pattern picks up the directory but misses the file. I think because the external application hasn't written the file yet.

    Here's my in file adapter:

    Code:
    <int-file:inbound-channel-adapter id="nistIn"
                                          directory="file:ext_files"
                                          filename-pattern="**" 
                                          channel="lssToFalcon" prevent-duplicates="false">
            <int:poller fixed-rate="1000" />
        </int-file:inbound-channel-adapter>
    for filename-pattern i've tried **/*.ext, but that doesn't pick up anything after the external app writes the directory.

    Any ideas on how I can read the .ext files ? Is there a filter I can write here?

    Thanks so much

  • #2
    This should work
    Code:
    <int-file:inbound-channel-adapter id="nistIn"
                                          directory="file:/absolute/path/to/directory"
                                          filename-pattern="*.ext" 
                                          channel="lssToFalcon" prevent-duplicates="false">
            <int:poller fixed-rate="1000" />
        </int-file:inbound-channel-adapter>
    or

    directory="/absolute/path/to/directory"

    Comment


    • #3
      just gave it a shot and it didn't work...

      Comment


      • #4
        What I would like to work is:

        Code:
        <int-file:inbound-channel-adapter id="nistIn"
                                              directory="/absolute/path/to/directory"
                                              filename-pattern="**/*.ext" 
                                              channel="lssToFalcon" prevent-duplicates="false">
                <int:poller fixed-rate="1000" />
            </int-file:inbound-channel-adapter>
        according to the examples here: http://static.springsource.org/sprin...thMatcher.html

        if i'm not mistaken it should find .ext files in directories underneath /absolute/path/to/directory

        so if I create a someDir that contains somefile.ext underneath /absolute/path/to/directory, i'm hoping it will pick up somefile.ext.

        Is that correct thinking?

        thanks

        Comment


        • #5
          Well, lets get something to work first. What OS are you on? Can you try to start from one of our working file samples? https://github.com/SpringSource/spri...ter/basic/file

          Comment


          • #6
            i'm using windows XP

            when I use filename-pattern="**" it picks up the directories. That works, but I want to pick up a file in the directory.

            I ran the basic/file tests and it works.

            thanks for your help. I know your busy. appreciate it.

            Comment


            • #7
              So it does work? Can you post your working configuration?

              Comment


              • #8
                sorry for being confusing...

                the following does not work

                Code:
                <int-file:inbound-channel-adapter id="nistIn"
                                                      directory="/absolute/path/to/directory"
                                                      filename-pattern="**/*.ext" 
                                                      channel="lssToFalcon" prevent-duplicates="false">
                        <int:poller fixed-rate="1000" />
                    </int-file:inbound-channel-adapter>
                this works but grabs the directories

                Code:
                <int-file:inbound-channel-adapter id="nistIn"
                                                      directory="/absolute/path/to/directory"
                                                      filename-pattern="**" 
                                                      channel="lssToFalcon" prevent-duplicates="false">
                        <int:poller fixed-rate="1000" />
                    </int-file:inbound-channel-adapter>
                and i'd like to only grab a file from the directories. Currently, I navigate the directories and grab the file in service code, but i'd like to use an ant-pattern to only grab file.

                any ideas? thanks
                Last edited by mdufresne; Jul 20th, 2012, 12:27 PM.

                Comment

                Working...
                X