public class FileMessageReceiver
extends org.mule.transport.AbstractPollingMessageReceiver
FileMessageReceiver is a polling listener that reads files from a
directory.| Modifier and Type | Field and Description |
|---|---|
static String |
COMPARATOR_CLASS_NAME_PROPERTY |
static String |
COMPARATOR_REVERSE_ORDER_PROPERTY |
static String |
MULE_TRANSPORT_FILE_SINGLEPOLLINSTANCE |
DEFAULT_POLL_FREQUENCY, DEFAULT_POLL_TIMEUNIT, DEFAULT_STARTUP_DELAY, schedulesdefaultInboundTransformers, defaultResponseTransformers, flowConstruct, listener, receiverKey, replyToHandler| Constructor and Description |
|---|
FileMessageReceiver(org.mule.api.transport.Connector connector,
org.mule.api.construct.FlowConstruct flowConstruct,
org.mule.api.endpoint.InboundEndpoint endpoint,
String readDir,
String moveDir,
String moveToPattern,
long frequency) |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
attemptFileLock(File sourceFile)
Try to acquire a lock on a file and release it immediately.
|
protected void |
basicListFiles(File currentDirectory,
List<File> discoveredFiles) |
protected void |
checkMustForceSync()
If we will be autodeleting File objects, events must be processed synchronously to avoid a race
|
protected org.mule.transport.file.ReceiverFileInputStream |
createReceiverFileInputStream(File sourceFile,
File destinationFile) |
protected org.mule.transport.file.ReceiverFileInputStream |
createReceiverFileInputStream(File sourceFile,
File destinationFile,
InputStreamCloseListener closeListener) |
protected void |
doConnect() |
protected void |
doDisconnect() |
protected void |
doDispose() |
protected void |
doInitialise() |
protected Comparator<File> |
getComparator() |
protected boolean |
isAgedFile(File file,
long fileAge)
Indicates whether or not file is older than the specified age
|
void |
poll() |
protected boolean |
pollOnPrimaryInstanceOnly() |
void |
processFile(File file) |
protected void |
rollbackFileMove(File sourceFile,
String destinationFilePath)
Exception tolerant roll back method
|
createWork, disableNativeScheduling, doStart, doStop, getBatchSize, getFrequency, getTimeUnit, performPoll, schedule, setFrequency, setTimeUnit, unscheduleapplyInboundTransformers, applyResponseTransformers, connectHandler, createExecutionTemplate, createLifecycleManager, createMuleEvent, doStartHandler, getConnectEventId, getConnectionDescription, getEndpoint, getEndpointURI, getFlowConstruct, getReceiverKey, getReplyToHandler, getWorkManager, handleUnacceptedFilter, initialise, processMessage, propagateRootMessageIdProperty, routeEvent, routeMessage, routeMessage, routeMessage, routeMessage, routeMessage, setEndpoint, setListener, setReceiverKey, shouldConsumeInEveryNode, toString, warnIfMuleClientSendUsedactivate, connect, createMuleMessage, createMuleMessage, createMuleMessage, createMuleMessageFactory, createNullMuleMessage, disconnect, dispose, disposeAndLogException, getConnectEventId, getConnector, getLifecycleState, initializeMessageFactory, initializeRetryPolicy, isConnected, isDoThreading, isStarted, isStarting, isStopped, isStopping, passivate, setEndpoint, start, stop, validate, validateConnectionclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcreateMuleMessage, createMuleMessagepublic static final String COMPARATOR_CLASS_NAME_PROPERTY
public static final String COMPARATOR_REVERSE_ORDER_PROPERTY
public static final String MULE_TRANSPORT_FILE_SINGLEPOLLINSTANCE
public FileMessageReceiver(org.mule.api.transport.Connector connector,
org.mule.api.construct.FlowConstruct flowConstruct,
org.mule.api.endpoint.InboundEndpoint endpoint,
String readDir,
String moveDir,
String moveToPattern,
long frequency)
throws org.mule.api.lifecycle.CreateException
org.mule.api.lifecycle.CreateExceptionprotected void checkMustForceSync()
throws org.mule.api.lifecycle.CreateException
org.mule.api.lifecycle.CreateExceptionprotected void doInitialise()
throws org.mule.api.lifecycle.InitialisationException
doInitialise in class org.mule.transport.AbstractTransportMessageHandlerorg.mule.api.lifecycle.InitialisationExceptionprotected void doConnect()
throws Exception
doConnect in class org.mule.transport.AbstractTransportMessageHandlerExceptionprotected void doDisconnect()
throws Exception
doDisconnect in class org.mule.transport.AbstractTransportMessageHandlerExceptionprotected void doDispose()
doDispose in class org.mule.transport.AbstractMessageReceiverpublic void poll()
poll in class org.mule.transport.AbstractPollingMessageReceiverprotected boolean pollOnPrimaryInstanceOnly()
pollOnPrimaryInstanceOnly in class org.mule.transport.AbstractPollingMessageReceiverpublic void processFile(File file) throws org.mule.api.MuleException
org.mule.api.MuleExceptionprotected boolean isAgedFile(File file, long fileAge)
file - file to checkfileAge - target file age in millisecondsprotected org.mule.transport.file.ReceiverFileInputStream createReceiverFileInputStream(File sourceFile, File destinationFile) throws FileNotFoundException
FileNotFoundExceptionprotected org.mule.transport.file.ReceiverFileInputStream createReceiverFileInputStream(File sourceFile, File destinationFile, InputStreamCloseListener closeListener) throws FileNotFoundException
FileNotFoundExceptionprotected boolean attemptFileLock(File sourceFile) throws org.mule.api.MuleException
sourceFile - file to checktrue if the file can be lockedorg.mule.api.MuleExceptionprotected void rollbackFileMove(File sourceFile, String destinationFilePath) throws IOException
ThrowableIOExceptionprotected Comparator<File> getComparator() throws Exception
ExceptionCopyright © 2003–2016 MuleSoft, Inc.. All rights reserved.