@UriEndpoint(firstVersion="1.0.0", scheme="file", title="File", syntax="file:directoryName", consumerClass=FileConsumer.class, label="core,file") public class FileEndpoint extends GenericFileEndpoint<File>
allowNullBody, antExclude, antFilter, antFilterCaseSensitive, antInclude, autoCreate, bufferSize, charset, configuration, DEFAULT_IDEMPOTENT_CACHE_SIZE, DEFAULT_IN_PROGRESS_CACHE_SIZE, DEFAULT_STRATEGYFACTORY_CLASS, delete, directoryMustExist, doneFileName, eagerDeleteTargetFile, eagerMaxMessagesPerPoll, exclude, exclusiveReadLockStrategy, fileExist, fileName, filter, filterDirectory, filterFile, flatten, idempotent, idempotentKey, idempotentRepository, include, inProgressRepository, jailStartingDirectory, keepLastModified, localWorkDirectory, log, maxDepth, maxMessagesPerPoll, minDepth, move, moveExisting, moveExistingFileStrategy, moveFailed, noop, onCompletionExceptionHandler, preMove, preSort, processStrategy, readLock, readLockCheckInterval, readLockDeleteOrphanLockFiles, readLockIdempotentReleaseAsync, readLockIdempotentReleaseAsyncPoolSize, readLockIdempotentReleaseDelay, readLockIdempotentReleaseExecutorService, readLockLoggingLevel, readLockMarkerFile, readLockMinAge, readLockMinLength, readLockRemoveOnCommit, readLockRemoveOnRollback, readLockTimeout, recursive, shuffle, sortBy, sorter, startingDirectoryMustExist, tempFileName, tempPrefix
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending
Constructor and Description |
---|
FileEndpoint() |
FileEndpoint(String endpointUri,
Component component) |
Modifier and Type | Method and Description |
---|---|
boolean |
chmodPermissionsAreValid(String chmod)
Chmod value must be between 000 and 777; If there is a leading digit like in 0755 we will ignore it.
|
FileConsumer |
createConsumer(Processor processor)
Creates a new Event
Driven Consumer which consumes messages from the endpoint using the
given processor
|
protected String |
createEndpointUri()
A factory method to lazily create the endpointUri if none is specified
|
Exchange |
createExchange(GenericFile<File> file) |
PollingConsumer |
createPollingConsumer()
Creates a new Polling
Consumer so that the caller can poll message exchanges from the
consumer using
PollingConsumer.receive() ,
PollingConsumer.receiveNoWait() or
PollingConsumer.receive(long) whenever it is ready to do so
rather than using the Event
Based Consumer returned by Endpoint.createConsumer(Processor) |
GenericFileProducer<File> |
createProducer()
Creates a new producer which is used send messages into the endpoint
|
String |
getChmod() |
String |
getChmodDirectory() |
Set<PosixFilePermission> |
getDirectoryPermissions() |
String |
getExtendedAttributes() |
File |
getFile() |
char |
getFileSeparator() |
Set<PosixFilePermission> |
getPermissions() |
String |
getScheme() |
boolean |
isAbsolute(String name) |
boolean |
isCopyAndDeleteOnRenameFail() |
boolean |
isForceWrites() |
boolean |
isProbeContentType() |
boolean |
isRenameUsingCopy() |
protected FileConsumer |
newFileConsumer(Processor processor,
GenericFileOperations<File> operations)
Strategy to create a new
FileConsumer |
void |
setChmod(String chmod)
Specify the file permissions which is sent by the producer, the chmod value must be between 000 and 777;
If there is a leading digit like in 0755 we will ignore it.
|
void |
setChmodDirectory(String chmodDirectory)
Specify the directory permissions used when the producer creates missing directories, the chmod value must be between 000 and 777;
If there is a leading digit like in 0755 we will ignore it.
|
void |
setCopyAndDeleteOnRenameFail(boolean copyAndDeleteOnRenameFail)
Whether to fallback and do a copy and delete file, in case the file could not be renamed directly.
|
void |
setExtendedAttributes(String extendedAttributes)
To define which file attributes of interest.
|
void |
setFile(File file)
The starting directory
|
void |
setForceWrites(boolean forceWrites)
Whether to force syncing writes to the file system.
|
void |
setProbeContentType(boolean probeContentType)
Whether to enable probing of the content type.
|
void |
setRenameUsingCopy(boolean renameUsingCopy)
Perform rename operations using a copy and delete strategy.
|
configureExchange, configureMessage, configureMoveOrPreMoveExpression, createDoneFileName, createGenericFileStrategy, doStart, doStop, getAntExclude, getAntFilter, getAntInclude, getBufferSize, getCharset, getConfiguration, getDoneFileName, getExchanges, getExclude, getExcludePattern, getExclusiveReadLockStrategy, getFileExist, getFileName, getFilter, getFilterDirectory, getFilterFile, getGeneratedFileName, getIdempotentKey, getIdempotentRepository, getInclude, getIncludePattern, getInProgressRepository, getLocalWorkDirectory, getMaxDepth, getMaxMessagesPerPoll, getMinDepth, getMove, getMoveExisting, getMoveExistingFileStrategy, getMoveFailed, getOnCompletionExceptionHandler, getParamsAsMap, getPreMove, getProcessStrategy, getReadLock, getReadLockCheckInterval, getReadLockIdempotentReleaseAsyncPoolSize, getReadLockIdempotentReleaseExecutorService, getReadLockLoggingLevel, getReadLockMinAge, getReadLockMinLength, getReadLockTimeout, getSortBy, getSorter, getTempFileName, getTempPrefix, isAllowNullBody, isAntFilterCaseSensitive, isAutoCreate, isDelete, isDirectoryMustExist, isDoneFile, isEagerDeleteTargetFile, isEagerMaxMessagesPerPoll, isFlatten, isIdempotent, isIdempotentSet, isJailStartingDirectory, isKeepLastModified, isNoop, isPreSort, isReadLockDeleteOrphanLockFiles, isReadLockIdempotentReleaseAsync, isReadLockMarkerFile, isReadLockRemoveOnCommit, isReadLockRemoveOnRollback, isRecursive, isShuffle, isSingleton, isStartingDirectoryMustExist, setAllowNullBody, setAntExclude, setAntFilterCaseSensitive, setAntInclude, setAutoCreate, setBufferSize, setCharset, setConfiguration, setDelete, setDirectoryMustExist, setDoneFileName, setEagerDeleteTargetFile, setEagerMaxMessagesPerPoll, setExclude, setExclusiveReadLockStrategy, setFileExist, setFileName, setFileName, setFilter, setFilterDirectory, setFilterDirectory, setFilterFile, setFilterFile, setFlatten, setIdempotent, setIdempotentKey, setIdempotentKey, setIdempotentRepository, setInclude, setInProgressRepository, setJailStartingDirectory, setKeepLastModified, setLocalWorkDirectory, setMaxDepth, setMaxMessagesPerPoll, setMinDepth, setMove, setMove, setMoveExisting, setMoveExisting, setMoveExistingFileStrategy, setMoveFailed, setMoveFailed, setNoop, setOnCompletionExceptionHandler, setPreMove, setPreMove, setPreSort, setProcessStrategy, setReadLock, setReadLockCheckInterval, setReadLockDeleteOrphanLockFiles, setReadLockIdempotentReleaseAsync, setReadLockIdempotentReleaseAsyncPoolSize, setReadLockIdempotentReleaseDelay, setReadLockIdempotentReleaseExecutorService, setReadLockLoggingLevel, setReadLockMarkerFile, setReadLockMinAge, setReadLockMinLength, setReadLockRemoveOnCommit, setReadLockRemoveOnRollback, setReadLockTimeout, setRecursive, setShuffle, setSortBy, setSortBy, setSortBy, setSorter, setStartingDirectoryMustExist, setTempFileName, setTempFileName, setTempPrefix
configurePollingConsumer, configureProperties, configureScheduledPollConsumerProperties, getBackoffErrorThreshold, getBackoffIdleThreshold, getBackoffMultiplier, getDelay, getInitialDelay, getPollStrategy, getRunLoggingLevel, getScheduledExecutorService, getScheduler, getSchedulerProperties, getTimeUnit, initConsumerProperties, isGreedy, isSendEmptyMessageWhenIdle, isStartScheduler, isUseFixedDelay, setBackoffErrorThreshold, setBackoffIdleThreshold, setBackoffMultiplier, setDelay, setGreedy, setInitialDelay, setPollStrategy, setRunLoggingLevel, setScheduledExecutorService, setScheduler, setScheduler, setSchedulerProperties, setSendEmptyMessageWhenIdle, setStartScheduler, setTimeUnit, setUseFixedDelay
configureConsumer, createEndpointConfiguration, createExchange, createExchange, createExchange, equals, getCamelContext, getComponent, getConsumerProperties, getEndpointConfiguration, getEndpointKey, getEndpointUri, getExceptionHandler, getExchangePattern, getId, getPollingConsumerBlockTimeout, getPollingConsumerQueueSize, hashCode, isBridgeErrorHandler, isLenientProperties, isPollingConsumerBlockWhenFull, isSynchronous, setBridgeErrorHandler, setCamelContext, setConsumerProperties, setEndpointConfiguration, setEndpointUri, setEndpointUriIfNotSpecified, setExceptionHandler, setExchangePattern, setPollingConsumerBlockTimeout, setPollingConsumerBlockWhenFull, setPollingConsumerQueueSize, setProperties, setSynchronous, toString
doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
configureProperties, createExchange, createExchange, createExchange, getCamelContext, getEndpointConfiguration, getEndpointKey, getEndpointUri, isLenientProperties, setCamelContext
public FileEndpoint()
public FileEndpoint(String endpointUri, Component component)
public FileConsumer createConsumer(Processor processor) throws Exception
Endpoint
createConsumer
in interface Endpoint
createConsumer
in class GenericFileEndpoint<File>
processor
- the given processorException
- can be thrownpublic PollingConsumer createPollingConsumer() throws Exception
Endpoint
PollingConsumer.receive()
,
PollingConsumer.receiveNoWait()
or
PollingConsumer.receive(long)
whenever it is ready to do so
rather than using the Event
Based Consumer returned by Endpoint.createConsumer(Processor)
createPollingConsumer
in interface Endpoint
createPollingConsumer
in class DefaultEndpoint
Exception
- if the pull consumer could not be createdpublic GenericFileProducer<File> createProducer() throws Exception
Endpoint
createProducer
in interface Endpoint
createProducer
in class GenericFileEndpoint<File>
Exception
- can be thrownpublic Exchange createExchange(GenericFile<File> file)
createExchange
in class GenericFileEndpoint<File>
protected FileConsumer newFileConsumer(Processor processor, GenericFileOperations<File> operations)
FileConsumer
processor
- the given processoroperations
- file operationspublic String getScheme()
getScheme
in class GenericFileEndpoint<File>
protected String createEndpointUri()
DefaultEndpoint
createEndpointUri
in class DefaultEndpoint
public char getFileSeparator()
getFileSeparator
in class GenericFileEndpoint<File>
public boolean isAbsolute(String name)
isAbsolute
in class GenericFileEndpoint<File>
public boolean isCopyAndDeleteOnRenameFail()
public void setCopyAndDeleteOnRenameFail(boolean copyAndDeleteOnRenameFail)
public boolean isRenameUsingCopy()
public void setRenameUsingCopy(boolean renameUsingCopy)
public boolean isForceWrites()
public void setForceWrites(boolean forceWrites)
public boolean isProbeContentType()
public void setProbeContentType(boolean probeContentType)
Files.probeContentType(java.nio.file.Path)
to
determine the content-type of the file, and store that as a header with key Exchange.FILE_CONTENT_TYPE
on the Message
.public String getExtendedAttributes()
public void setExtendedAttributes(String extendedAttributes)
public boolean chmodPermissionsAreValid(String chmod)
public Set<PosixFilePermission> getPermissions()
public void setChmod(String chmod) throws Exception
Exception
public Set<PosixFilePermission> getDirectoryPermissions()
public String getChmodDirectory()
public void setChmodDirectory(String chmodDirectory) throws Exception
Exception
Apache Camel