Are you trying to dynamically change directory from where you want to download 
files ?

It seems it is not possible for to uri in ftp component.

You might want to use filter which can specify the pattern to select for 
download . Something like ...

public class MyFileFilter<T> implements GenericFileFilter<T> {

    public boolean accept(GenericFile<T> file) {
        // we only want report files
        String timeStr = ( System.currentTimeMillis() + "" ).substring(8); // 
You can decide how your string will be compiled.
        String filePath = file.getAbsoluteFilePath();
            return filePath.contains(timeStr);
    }
}

Regards

Ravi
+91 98 509 760 91

VNET: 206830

iThink :  https://c2blogs.cognizant.com/blogs/115750/


-----Original Message-----
From: npayaresc [mailto:nicolas.paya...@gmail.com]
Sent: Wednesday, April 02, 2014 11:05 PM
To: users@camel.apache.org
Subject: how to set up ftp remote directory dynamically

hello,

I am trying to set up my ftp cleint connection in Spring DSL like:


                <route routePolicyRef="myPolicy" 
id="pcrf-ftp-server-berlin-now-3"
autoStartup="true">
                        <from

uri="ftp://localhost/${bean:timeItervallToDownload?method=getOneDayBeforeYesterday}?username=test&amp;password=test&amp;stepwise=false&amp;delay=2000&amp;move=${file:name}.trans&amp;recursive=true&amp;binary=true&amp;filter=#doneFilter&amp;maxMessagesPerPoll=3500&amp;eagerMaxMessagesPerPoll=false&amp;sorter=#pcrfSorter";
/>
                        <onCompletion>
                                <process 
ref="startPcrfFtpBerlinRoute-now-2"></process>
                        </onCompletion>
                        <multicast>
                                <to 
uri="file://C:/temp/outputfile/pcrf_files_postpaid" />
                                <log message="Downloaded file ${file:name} 
complete."></log>
                        </multicast>
                </route>


Unfortunatelly without success.  The main issue is in the call of the bean:

${bean:timeItervallToDownload?method=getOneDayBeforeYesterday}


the bean is in the camel context:

<bean id="timeItervallToDownload"
class="com.test.nico.DownloadStrategy"></bean>

what am i doing wrong?

Any help would be much appreciated.

Regards,

Nico




--
View this message in context: 
http://camel.465427.n5.nabble.com/how-to-set-up-ftp-remote-directory-dynamically-tp5749671.html
Sent from the Camel - Users mailing list archive at Nabble.com.

This e-mail and any files transmitted with it are for the sole use of the 
intended recipient(s) and may contain confidential and privileged information. 
If you are not the intended recipient(s), please reply to the sender and 
destroy all copies of the original message. Any unauthorized review, use, 
disclosure, dissemination, forwarding, printing or copying of this email, 
and/or any action taken in reliance on the contents of this e-mail is strictly 
prohibited and may be unlawful.

Reply via email to