This content has been marked as final.
Show 3 replies
-
1. Re: <fs-provider > get original filename
tfennelly Oct 4, 2007 8:19 AM (in response to kodi_x7)The default local file MessageComposer doesn't attach the original file name to the composed ESB Message, but that's easy enough for you to do by simply extending its compose() method and adding the file/name to the composed message ala...
public class MyLocalFileMessageComposer<T extends File> extends LocalFileMessageComposer<T> { public Message compose(T inputFile) throws MessageDeliverException { Message message = super.compose(inputFile); message.getProperties().setProperty("original-file", inputFile); return message; } }
And then specifying your own composer impl on the fs-listener ala...<fs-listener name="x" busidref="blah" is-gateway="true"> <property name="composer-class" value="com.acme.composers.MyLocalFileMessageComposer" /> </fs-listener>
And then in your action....public Message process(Message message) throws Exception { File originalFile = (File) message.getProperties().getProperty("original-file"); ..... }
-
2. Re: <fs-provider > get original filename
edgar.silva Oct 5, 2007 1:13 PM (in response to kodi_x7)Hi dude,
I did using a different way but is also working.
See:public Message processMessage(Message message) throws Exception { String fileName = (String) message.getProperties().getProperty("org.jboss.soa.esb.gateway.original.file.name"); System.out.println("File:" + fileName); return message; }
I hope this help you.
Regards
Edgar -
3. Re: <fs-provider > get original filename
sebcio Oct 9, 2007 10:18 AM (in response to kodi_x7)Hi kodi_x7,
this property was added in MR3, so please use JBossESB4.2GA. Please also check your filters section of the jbossesb-properties.xml (see Programmers Guide, page 53). In my project, it works fine. I hope, it helps.
Regards,
Sebastian