You might be able to use a org.apache.camel.component.file.GenericFileFilter instance as a filter. If directories are passed to that, then you can write your own filter to only return directories.
Would prob also need a processStrategy so that you only start processing once the directory upload is complete (a time comparison on last file added time?). On Tue, Jul 3, 2012 at 4:51 PM, dealbitte <[email protected]>wrote: > Hi, > > I have the following requirement and I would like to know if it is possible > to implement it with Camel. > > Requirement: There exists a directory 'Drop-box' where users can drop > directories in this 'Drop-box'. It should be possible to detect such > directories (not files) dropped in the 'Drop-box' and generate a file (say > using processor) and pack the detected directory and the generated file > into > a new directory and move it to 'Output' directory. > > Let's say directory 'A' has 3 files (f1.txt, f2.xml, f3.xsd). If a user > drops directory 'A' in the 'Drop-box' which is being monitored by the > camel, > it should be possible with camel routes to detect the directory 'A' and > create a file (say, info.xml) and then create a new directory called > 'A-updated' whose contents should be directory 'A' and file 'info.xml'. At > the end of the route this 'A-updated' directory will be moved to 'Output' > directory. > > As far as i know, files can be detected by camel but not directory. The > option 'recursive=true' for the File component traverses the > sub-directories > and processes the files, but my requirement is to treat the whole directory > as if it is a file. > > Is there a way in camel to achieve the above flow ? Please share your > thoughts. > > The current work around is to manually zip the directory and then dropping > it in the 'Drop-box'. > > Regards. > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Consuming-and-updating-directory-using-camel-endpoint-tp5715413.html > Sent from the Camel - Users mailing list archive at Nabble.com. > -- -Sam
