public class FileConsumer extends GenericFileConsumer<File>
customProcessor, eagerLimitMaxMessagesPerPoll, endpoint, fileExpressionResult, log, operations, pendingExchanges, prepareOnStartup, shutdownRunningTask
maxMessagesPerPoll
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending
Constructor and Description |
---|
FileConsumer(FileEndpoint endpoint,
Processor processor,
GenericFileOperations<File> operations) |
Modifier and Type | Method and Description |
---|---|
static GenericFile<File> |
asGenericFile(String endpointPath,
File file,
String charset)
Deprecated.
|
static GenericFile<File> |
asGenericFile(String endpointPath,
File file,
String charset,
boolean probeContentType)
Creates a new GenericFile
|
FileEndpoint |
getEndpoint()
Gets the endpoint associated with an object.
|
protected boolean |
isMatched(GenericFile<File> file,
String doneFileName,
List<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,
Message message)
Updates the information on
Message after we have acquired read-lock and
can begin process the file. |
afterPoll, beforePoll, canPollMoreFiles, customProcessExchange, doStart, doStop, evaluateFileExpression, getCustomProcessor, ignoreCannotRetrieveFile, isEagerLimitMaxMessagesPerPoll, isInProgress, isMatched, isRetrieveFile, isValidFile, onInit, poll, postPollCheck, prePollCheck, processBatch, processExchange, removeExcessiveInProgressFiles, removeExcessiveInProgressFiles, setCustomProcessor, setEagerLimitMaxMessagesPerPoll, setOperations
deferShutdown, getMaxMessagesPerPoll, getPendingExchangesSize, isBatchAllowed, prepareShutdown, processEmptyMessage, setMaxMessagesPerPoll
doShutdown, doSuspend, getBackoffCounter, getBackoffErrorThreshold, getBackoffIdleThreshold, getBackoffMultiplier, getDelay, getInitialDelay, getPollStrategy, getRunLoggingLevel, getScheduledExecutorService, getScheduler, getSchedulerProperties, getTimeUnit, isGreedy, isPollAllowed, isPolling, isSchedulerStarted, isSendEmptyMessageWhenIdle, isStartScheduler, isUseFixedDelay, run, setBackoffErrorThreshold, setBackoffIdleThreshold, setBackoffMultiplier, setDelay, setGreedy, setInitialDelay, setPollStrategy, setRunLoggingLevel, setScheduledExecutorService, setScheduler, setSchedulerProperties, setSendEmptyMessageWhenIdle, setStartScheduler, setTimeUnit, setUseFixedDelay, startScheduler
createUoW, doneUoW, getAsyncProcessor, getExceptionHandler, getProcessor, getRoute, handleException, handleException, setExceptionHandler, setRoute, toString
doResume, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
public FileConsumer(FileEndpoint endpoint, Processor processor, GenericFileOperations<File> operations)
protected boolean pollDirectory(String fileName, List<GenericFile<File>> fileList, int depth)
GenericFileConsumer
pollDirectory
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, List<File> files)
GenericFileConsumer
isMatched
in class GenericFileConsumer<File>
file
- the filedoneFileName
- the done file name (without any paths)files
- files in the directory@Deprecated public static GenericFile<File> asGenericFile(String endpointPath, File file, String charset)
asGenericFile(String, File, String, boolean)
endpointPath
- the starting directory the endpoint was configured withfile
- the source filepublic 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, Message message)
GenericFileConsumer
Message
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()
EndpointAware
Producer
or for consuming from for components like Consumer
or Route
getEndpoint
in interface EndpointAware
getEndpoint
in class DefaultConsumer
Apache Camel