public class FileConsumer extends GenericFileConsumer<File>
customProcessor, eagerLimitMaxMessagesPerPoll, endpoint, operations, pendingExchanges, prepareOnStartup, processStrategy, shutdownRunningTask| Constructor and Description |
|---|
FileConsumer(FileEndpoint endpoint,
org.apache.camel.Processor processor,
GenericFileOperations<File> operations,
GenericFileProcessStrategy<File> processStrategy) |
| Modifier and Type | Method and Description |
|---|---|
static GenericFile<File> |
asGenericFile(String endpointPath,
File file,
String charset,
boolean probeContentType)
Creates a new GenericFile
|
protected org.apache.camel.Exchange |
createExchange(GenericFile<File> file)
Creates the exchange from the polled file
|
FileEndpoint |
getEndpoint() |
protected boolean |
isMatched(GenericFile<File> file,
String doneFileName,
File[] files)
Strategy to perform file matching based on endpoint configuration in terms of done file name.
|
protected boolean |
pollDirectory(String fileName,
List<GenericFile<File>> fileList,
int depth)
Polls the given directory for files to process
|
protected void |
updateFileHeaders(GenericFile<File> file,
org.apache.camel.Message message)
Updates the information on
Message after we have acquired read-lock and can begin process the file. |
afterPoll, beforePoll, canPollMoreFiles, customProcessExchange, doInit, doStart, doStop, evaluateFileExpression, getCustomProcessor, ignoreCannotRetrieveFile, isEagerLimitMaxMessagesPerPoll, isMatched, isRetrieveFile, isValidFile, onInit, poll, postPollCheck, prePollCheck, processBatch, processExchange, removeExcessiveInProgressFiles, removeExcessiveInProgressFiles, setCustomProcessor, setEagerLimitMaxMessagesPerPoll, setOperationsdeferShutdown, getMaxMessagesPerPoll, getPendingExchangesSize, isBatchAllowed, prepareShutdown, processEmptyMessage, setMaxMessagesPerPolladdLastErrorDetail, afterConfigureScheduler, doBuild, doShutdown, doSuspend, getBackoffCounter, getBackoffErrorThreshold, getBackoffIdleThreshold, getBackoffMultiplier, getCounter, getDelay, getErrorCounter, getInitialDelay, getLastError, getLastErrorDetails, getPollStrategy, getRepeatCount, getRunLoggingLevel, getScheduledExecutorService, getScheduler, getSchedulerProperties, getSuccessCounter, getTimeUnit, isFirstPollDone, isGreedy, isPollAllowed, isPolling, isSchedulerStarted, isSendEmptyMessageWhenIdle, isStartScheduler, isUseFixedDelay, run, setBackoffErrorThreshold, setBackoffIdleThreshold, setBackoffMultiplier, setDelay, setGreedy, setInitialDelay, setPollStrategy, setRepeatCount, setRunLoggingLevel, setScheduledExecutorService, setScheduler, setSchedulerProperties, setSendEmptyMessageWhenIdle, setStartScheduler, setTimeUnit, setUseFixedDelay, startSchedulercreateExchange, createUoW, defaultConsumerCallback, doneUoW, getAsyncProcessor, getExceptionHandler, getHealthCheck, getProcessor, getRoute, getRouteId, handleException, handleException, releaseExchange, setExceptionHandler, setHealthCheck, setRoute, setRouteId, toStringbuild, doFail, doLifecycleChange, doResume, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcreateExchange, defaultConsumerCallback, getProcessor, releaseExchangegetHealthCheck, setHealthCheckpublic FileConsumer(FileEndpoint endpoint, org.apache.camel.Processor processor, GenericFileOperations<File> operations, GenericFileProcessStrategy<File> processStrategy)
protected org.apache.camel.Exchange createExchange(GenericFile<File> file)
GenericFileConsumercreateExchange in class GenericFileConsumer<File>protected boolean pollDirectory(String fileName, List<GenericFile<File>> fileList, int depth)
GenericFileConsumerpollDirectory in class GenericFileConsumer<File>fileName - current directory or filefileList - current list of files gathereddepth - the current depth of the directory (will start from 0)protected boolean isMatched(GenericFile<File> file, String doneFileName, File[] files)
GenericFileConsumerisMatched in class GenericFileConsumer<File>file - the filedoneFileName - the done file name (without any paths)files - files in the directorypublic static GenericFile<File> asGenericFile(String endpointPath, File file, String charset, boolean probeContentType)
endpointPath - the starting directory the endpoint was configured withfile - the source fileprobeContentType - whether to probe the content type of the file or notprotected void updateFileHeaders(GenericFile<File> file, org.apache.camel.Message message)
GenericFileConsumerMessage after we have acquired read-lock and can begin process the file.updateFileHeaders in class GenericFileConsumer<File>file - the filemessage - the Camel message to update its headerspublic FileEndpoint getEndpoint()
getEndpoint in interface org.apache.camel.EndpointAwaregetEndpoint in class org.apache.camel.support.DefaultConsumerApache Camel