RE: Copy current file in a folder

2016-12-09 Thread axdz
With code *Date date = new Date(); date.setHours(9); date.setMinutes(44); date.setSeconds(1); System.out.println("now :" + date.getTime()); if (date.getTime() > file.getLastModified()) { System.out.println(file.getFileName() + ":" + file

RE: Copy current file in a folder

2016-12-08 Thread Hans Orbaan
uot; and only let your route be active during a certain schedule. -Oorspronkelijk bericht- Van: axdz [mailto:hoida...@gmail.com] Verzonden: Thursday 8 December 2016 4:22 Aan: users@camel.apache.org Onderwerp: Re: Copy current file in a folder Dear, I tried to implement by using th

Re: Copy current file in a folder

2016-12-07 Thread axdz
Dear, I tried to implement by using their timestamp. Please tell me LastLastModified is timestamp or not? With LastModified , I can not compare with 05:00. public class FileFilters implements GenericFileFilter { public boolean accept(GenericFile file) { System.out.println(file.g

Re: Copy current file in a folder

2016-12-07 Thread Claus Ibsen
Filter the files by their timestamp so you only select the files that are before 5:00. On Wed, Dec 7, 2016 at 11:36 AM, axdz wrote: > Dear, > > To distinguish those files, I only one information ,some file were moved to > folder1 before 05:00 (5 file), some file were moved to folder1 after 05:00(

Re: Copy current file in a folder

2016-12-07 Thread axdz
Dear, To distinguish those files, I only one information ,some file were moved to folder1 before 05:00 (5 file), some file were moved to folder1 after 05:00(2 file), later camel copy these file (files were copy to folder1 before 05:00) to folder2. How can I implement this work? Thanks for replyin

Re: Copy current file in a folder

2016-12-07 Thread souciance
Well you need to somehow to distinguish those files from files you don't want to copy. Otherwise put them in separate folders. On Wed, Dec 7, 2016 at 10:57 AM, axdz [via Camel] < ml-node+s465427n5791181...@n5.nabble.com> wrote: > Dear, > > I tried to implement this with cron policy.But when these

Re: Copy current file in a folder

2016-12-07 Thread axdz
Dear, I tried to implement this with cron policy.But when these 5 files are being copied, if I move 2 files (file6, file7) to folder1, camel also copy these 2 files from folder1 to folder2. Thanks for replying to me. -- View this message in context: http://camel.465427.n5.nabble.com/Copy-cur

Re: Copy current file in a folder

2016-12-07 Thread axdz
Dear, These five file have no specific name or pattern. My problem is : Copy all file in a folder at 05:00 everyday.files are moved to this folder after 05:00 will not be copied and will be copied at 05:00 next day.Here, I only want to copy one time a day. Thanks for replying to me. Please give

Re: Copy current file in a folder

2016-12-07 Thread souciance
I believe Claus give you the advice of using the cron scheduler to set when your route should be triggered. Use that to trigger it at the time you want. On Wed, Dec 7, 2016 at 10:50 AM, axdz [via Camel] < ml-node+s465427n5791178...@n5.nabble.com> wrote: > Dear, > > These five file have no specifi

Re: Copy current file in a folder

2016-12-07 Thread Claus Ibsen
Use the cron scheduler http://camel.apache.org/file2 http://camel.apache.org/polling-consumer.html http://www.davsclaus.com/2013/08/apache-camel-212-even-easier-cron.html On Wed, Dec 7, 2016 at 10:30 AM, axdz wrote: > Dear, > > Thanks for replying to me. > Yes I want copy files one time at 05:15

Re: Copy current file in a folder

2016-12-07 Thread axdz
Dear, Thanks for replying to me. Yes I want copy files one time at 05:15 PM everyday. I set route start time at 05:15 PM. At 05:15 PM there are 5 files in folder1 and I only need to copy these 5 files. file6 and file7 will be copied at 05:15 PM next day. How can I do this work? Thanks, -- V

Re: Copy current file in a folder

2016-12-07 Thread souciance
If those five files have a specific file name or pattern you can use that in your filter to only process those. On Wed, Dec 7, 2016 at 10:30 AM, axdz [via Camel] < ml-node+s465427n5791174...@n5.nabble.com> wrote: > Dear, > > Thanks for replying to me. > Yes I want copy files one time at 05:15 PM

Re: Copy current file in a folder

2016-12-07 Thread Claus Ibsen
What is your use case? Why do you only want to copy 5 files, are those special files. Or do you only want to copy the first 5 files and never ever any more files? Should you only copy files one time? etc. Usually people want to process any incoming files, and hence why Camel will pickup any new f

RE: Copy current file in a folder

2016-12-07 Thread axdz
Dear, I tried to implement fileFilter, but I don't know how to copy only 5 files (file1, file2, file3, file4, file5) *public class FileFilters implements GenericFileFilter { public boolean accept(GenericFile file) { String fileName = file.getFileName(); return false; } }

RE: Copy current file in a folder

2016-12-06 Thread Hans Orbaan
Use antInclude or implement a fileFilter -Oorspronkelijk bericht- Van: axdz [mailto:hoida...@gmail.com] Verzonden: Tuesday 6 December 2016 11:38 Aan: users@camel.apache.org Onderwerp: Copy current file in a folder Dear all, I have a route from("file:D:\\folder1").to("file:D:\\folder2").