-
1. Re: Multiple dynamic file poller instances
joe.luo Oct 22, 2009 6:11 AM (in response to guillaume.bardy)Once a file poller endpoint is initialized, you can not change target directory that the file poller will poll the files from.
Have you tried with "filter" properties of the file poller to selectively poll files from designated directory based on filter criteria?
-
2. Re: Multiple dynamic file poller instances
guillaume.bardy Oct 22, 2009 9:39 PM (in response to joe.luo)Thanks, that's actually an idea.
It depends on how "powerful" this filter is. To be specific in my case, i am waiting for a xml file to be deleted (in a subdirectory sub1) to poll another xml file (in a subdirectory sub2).
I have plenty (and the number is dynamic at runtime) of these subdirectories like this:
root
dir1
*subdir1
*subdir2
dir2
*subdir1
*subdir2
I think if the filter allows me to put a condition (like no xml in subdir1) and this name in subdir2 with relative path it should be alright.
Is that possible?
-
3. Re: Multiple dynamic file poller instances
davsclaus Oct 23, 2009 3:22 AM (in response to guillaume.bardy)You can implement you own class that implements the java.io.FileFilter where you can determine which files to include or not.
As you get hold of the java.io.File object you have all the information about absolute paths, name, parent directory etc.
-
4. Re: Multiple dynamic file poller instances
guillaume.bardy Oct 25, 2009 9:20 PM (in response to davsclaus)So you are advising to create a POJO implementing the logic I need. It is definately a possibility, but I was looking for a more "standard way" of doing things... re-use existing components.