How to read file name in transformer using 'file:inbound-endpoint' in Mule-3.2.1

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

How to read file name in transformer using 'file:inbound-endpoint' in Mule-3.2.1

Sesharao Nuthanki
This post has NOT been accepted by the mailing list yet.
Hi All,
Can any one assist me to read file name in doTransform() method?

Please find sample code below:

Mule Configuration File:
 <flow name="flow1" processingStrategy="synchronous">
     
        <file:inbound-endpoint connector-ref="inboundFileConnector" path="C:\input"
                               moveToDirectory="C:\input\processed"
                               transformer-refs="XmlFilterTransformer"
                               comparator="org.mule.transport.file.comparator.OlderFirstComparator"
                               disableTransportTransformer="true"/>

        <collection-splitter/>
    </flow>

Transformer Calss:
public class XmlFilterTransformer extends AbstractTransformer {
 protected Object doTransform(Object in, String encoding) throws TransformerException {
...
}
}

Thanks,
Sesharao.
-Sesha Rao.Nuthanki