Thanks, Claus. I agree with you and I implement the GenericFileFilter as below
public class FileTransferFilter implements GenericFileFilter { @Override public boolean accept(GenericFile pathname) { // we don't accept any files starting with skip in the name return !pathname.getFileName().startsWith("skip"); } } but for my case, skip is not hard coded value, it is dynamic variable from ready file name, how could I pass this variable to this filter? On Mon, Dec 2, 2019 at 11:20 PM Claus Ibsen <claus.ib...@gmail.com> wrote: > Hi > > Instead of using doneFileName which AFAIR is a 1:1 with file and done > file, then you can implement a custom file filter and configure on the > file endpoint, and then return true|false whether you can find a done > file name yourself via the java api. > > > On Mon, Dec 2, 2019 at 9:41 PM WEIQUAN YUAN <weiquan.y...@gmail.com> > wrote: > > > > I have one requirement to transfer file depends on the done file name > > > > for example, in the drop folder inputDir, if there is file named > > 123456.done dropped, I need to move all the file whose name including > > 123456 to outputDir. if there is file named 456789.done dropped, I need > to > > move all the files whose name including 456789 to outputDir. > > > > I know that we have doneFileName=${filel.name}.done, but how to reuse > this > > ${file.name} in the include regular expression to filter file name? > > > > file://inputDir?delete=true&include=^.*_ ${file.name > > }_[0-9]{5}.dat$&doneFilenName=${file.name}.ready > > > > > > thanks > > > > -- > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > Weiquan Yuan > > Located in Ottawa, Canada > > > > -- > Claus Ibsen > ----------------- > http://davsclaus.com @davsclaus > Camel in Action 2: https://www.manning.com/ibsen2 > -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Weiquan Yuan Located in Ottawa, Canada