On Thu, Dec 11, 2008 at 3:35 AM, ychawla <[EMAIL PROTECTED]> wrote: > > Hello All, > I have a method that is writing out files to multiple destinations. Rather > than configure a route for each destination, I would like to use a single > bean and route to do it. I set up a route like this for example: > > <route> > <from uri="bean:myBean"/> > <to uri="file:/rootDirectory"/> > </route> > > Then in 'myBean', I set the FileComponent.HEADER_FILE_NAME to be something > like 'subdirectory1/subdirectory2/myFileName.xml'. The file is then written > to /rootDirectory/subdirectory1/subdirectory2/myFileName.xml. > > This works great and allows me to write to many different subfolders of > 'rootDirectory' with a single bean. Was this the way the Camel File > component was intended to be used or am I just hacking this improperly? > > If this is correct, let me know if this would be something worth including > on the wiki: > http://activemq.apache.org/camel/file.html Yes you are doing it correctly. The FileComponent.HEADER_FILE_NAME is to be used to set explicit the filename you want files to be written as.
FileComponent.HEADER_FILE_NAME = hello.txt => /rootDirectory/hello.txt FileComponent.HEADER_FILE_NAME = foo/bye.txt => /rootDirectory/foo/bye.txt Yes please fell free to write about this on the camel-file wiki page. This component has many options and is flexible but the wiki could use a brush with a few more examples. > > Thanks, > Yogesh > -- > View this message in context: > http://www.nabble.com/FileComponent.HEADER_FILE_NAME-usage-tp20948456s22882p20948456.html > Sent from the Camel - Users mailing list archive at Nabble.com. > > -- /Claus Ibsen Apache Camel Committer Blog: http://davsclaus.blogspot.com/