The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

daianacheng (3) [Avatar] Offline
Hi There,

I'm trying to modify the file polling example to monitor a folder and when a new file arrives invoke a web service. What I need to do is to send the filename as the web service parameter, so basically I want to get rid of the file itself, which is the message that gets sent to the outbound where I define the webservice and just send a String with the fileName.

I don't know how to convert the message from a File to a String containing just the fileName....Should I implement a Transformer? (I tried doing this but the message type is ReceiverFileInputStream which is not visible in the org.mule.transport.file package, so it seems that I can't work with it...)

Many many thanks in advance.

Best regards,
tijs.rademakers (494) [Avatar] Offline
Re: File Transport's File Name
Hi Diana,

To pass a File object to the Mule container instead of a FileInputStream you should add the following line to your Mule configuration, above the model element.

<file:connector name="fileConnector" streaming="false" />

Then you should be able implement a Transform to pass on the filename.

Best regards,