Is it possible to create file components dynamically?

I have an interface that gives me File objects (after a physical file has
been created on disk) that I would like to send to a remote FTP address. The
files are created one at the time, in different folders and with different
file names. The files should only be sent once and should also remain on the
origin location after they have been sent, e.g. by using the noop option.



void sendViaFtp(File file, String userName, String host) {
    from(getFileUri(file)).to(getFtpUri(userName, host, file));
}

private static String getFileUri(File file) {
    return String.format("file://%s?fileName=%s?noop=true",
filenameUtils.getPath(file.getAbsolutePath()), file.getName());
}

private static String getFtpUri(String userName, String host, File file) {
    return String.format("ftp://%...@%s/%s";, userName, host, file.getName());
}



-- 
View this message in context: 
http://old.nabble.com/Dynamic-origin-file-components--tp28705368p28705368.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to