@Override
public MuleEvent process() throws Exception
{
// A bit tricky initialization of the notifier in this case since we don't
// have access to the message yet...
SftpNotifier notifier = new SftpNotifier((SftpConnector) connector, createNullMuleMessage(),
endpoint, flowConstruct.getName());
InputStream inputStream = sftpRRUtil.retrieveFile(path, notifier);
if (logger.isDebugEnabled())
{
logger.debug("Routing file: " + path);
}
MuleMessage message = createMuleMessage(inputStream);
message.setProperty(SftpConnector.PROPERTY_FILENAME, path, PropertyScope.INBOUND);
message.setProperty(SftpConnector.PROPERTY_ORIGINAL_FILENAME, path, PropertyScope.INBOUND);
// Now we have access to the message, update the notifier with the message
notifier.setMessage(message);
routeMessage(message);
if (logger.isDebugEnabled())
{
logger.debug("Routed file: " + path);