Hi Welcome to the Camel community.
You can code a custom filter and use that on the SFTP endpoint Since the FTP component inherits almost all the options from the File component. You can find more details here http://camel.apache.org/file2 The filter class should be of type: org.apache.camel.component.file.GenericFileFilter Then you have access to file name / file parent details etc, and can determine if you want to copy the file or not, by retning a boolean. On Sat, Oct 8, 2011 at 4:45 PM, newbiee <[email protected]> wrote: > I have written a program to FTP files from a server to a folder on my laptop > using SFTP component. The program is able to copy. I had to just write one > line of code (excluding boilderplate code) to get everything done. Thank > you CAMEL! > > Now I want to enhance this program. Here is how I want this program to copy > files. > > There is a parent folder on the server. Under this folder there are many > folders. Each folder is names as "date-hr-min-sec" and each folder contains > 15 files again each file's names is actually a time stamp when the file was > created. > > Since there are 100's of files and I don't want to copy all the files on my > laptop, instead I want to create a search criteria and copy the files that > meet the search criteria. For example, let's say my search criteria is ot > copy files that fall in a certain time rage say I want to copy all the files > that fall in the time ranfe from October 8 at 8:00 AM to October 8 at 8:05 > AM. In this case, I will first have to search for the folder than has the > time stamp that meets the search criteria. Next I will need to just pick the > files that meet the search criteria. > > I would like to know how can I accomplish this using CAMEL. I think I will > have to call processes to first pick the right folder name (which meets the > search criteria) then in the "from" part dynamically pass the folder name > and then use FITER EIP to download files that meet the search criteria. I > don't know how can I create a process and connect to the server to read the > folder names (I'm not sure, I want to solve the problem in CAMEL way) Please > explain. > > Thank you > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Copying-files-from-an-FTP-server-using-search-criteria-tp4882889p4882889.html > Sent from the Camel - Users mailing list archive at Nabble.com. > -- Claus Ibsen ----------------- FuseSource Email: [email protected] Web: http://fusesource.com Twitter: davsclaus, fusenews Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/
