|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.camel.impl.DefaultEndpoint<E>
org.apache.camel.impl.ScheduledPollEndpoint<FileExchange>
org.apache.camel.component.file.FileEndpoint
public class FileEndpoint
A File Endpoint for working with file systems
Field Summary | |
---|---|
static String |
DEFAULT_LOCK_FILE_POSTFIX
|
Constructor Summary | |
---|---|
|
FileEndpoint()
|
|
FileEndpoint(File file)
|
protected |
FileEndpoint(File file,
String endpointUri,
FileComponent component)
|
|
FileEndpoint(String endpointUri,
File file)
|
Method Summary | |
---|---|
void |
configureMessage(File file,
Message message)
Configures the given message with the file which sets the body to the file object and sets the FileComponent.HEADER_FILE_NAME header. |
Consumer<FileExchange> |
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 |
FileExchange |
createExchange()
Create a new exchange for communicating with this endpoint |
FileExchange |
createExchange(ExchangePattern pattern)
Create a new exchange for communicating with this endpoint with the specified ExchangePattern such as whether its going
to be an ExchangePattern.InOnly or ExchangePattern.InOut exchange |
FileExchange |
createExchange(File file)
Create a new exchange for communicating with this endpoint |
protected FileProcessStrategy |
createFileStrategy()
A strategy method to lazily create the file strategy |
Producer<FileExchange> |
createProducer()
Creates a new producer which is used send messages into the endpoint |
int |
getBufferSize()
|
String |
getExcludedNamePostfix()
|
String[] |
getExcludedNamePostfixes()
|
String |
getExcludedNamePrefix()
|
String[] |
getExcludedNamePrefixes()
|
Expression |
getExpression()
|
File |
getFile()
|
protected String |
getFileFriendlyMessageId(String id)
|
FileProcessStrategy |
getFileStrategy()
|
String |
getGeneratedFileName(Message message)
Return the file name that will be auto-generated for the given message if none is provided |
String |
getMoveNamePostfix()
|
String |
getMoveNamePrefix()
|
protected Map<String,Object> |
getParamsAsMap()
|
Expression |
getPreMoveExpression()
|
String |
getPreMoveNamePostfix()
Sets the name prefix appended to pre moved files. |
String |
getPreMoveNamePrefix()
|
boolean |
isAppend()
|
boolean |
isAutoCreate()
|
boolean |
isDelete()
|
boolean |
isIgnoreFileNameHeader()
|
boolean |
isLock()
|
boolean |
isNoop()
|
boolean |
isSingleton()
Returns if the endpoint should be a CamelContext singleton. |
void |
setAppend(boolean append)
When writing do we append to the end of the file, or replace it? The default is to append |
void |
setAutoCreate(boolean autoCreate)
|
void |
setBufferSize(int bufferSize)
Sets the buffer size used to read/write files |
void |
setDelete(boolean delete)
|
void |
setExcludedNamePostfix(String excludedNamePostfix)
|
void |
setExcludedNamePostfixes(String[] excludedNamePostfixes)
Deprecated. use ExcludedNamePostfix. Will be removed in Camel 2.0. |
void |
setExcludedNamePrefix(String excludedNamePrefix)
|
void |
setExcludedNamePrefixes(String[] excludedNamePrefixes)
Deprecated. use ExcludedNamePrefix. Will be removed in Camel 2.0. |
void |
setExpression(Expression expression)
|
void |
setExpression(String fileLanguageExpression)
Sets the expression based on FileLanguage |
void |
setFile(File file)
|
void |
setFileStrategy(FileProcessStrategy fileProcessStrategy)
Sets the strategy to be used when the file has been processed such as deleting or renaming it etc. |
void |
setIgnoreFileNameHeader(boolean ignoreFileNameHeader)
If this flag is enabled then producers will ignore the FileComponent.HEADER_FILE_NAME
header and generate a new dynamic file |
void |
setLock(boolean lock)
|
void |
setMoveNamePostfix(String moveNamePostfix)
Sets the name postfix appended to moved files. |
void |
setMoveNamePrefix(String moveNamePrefix)
Sets the name prefix appended to moved files. |
void |
setNoop(boolean noop)
If set to true then the default FileProcessStrategy will be to use the
NoOpFileProcessStrategy
to not move or copy processed files |
void |
setPreMoveExpression(Expression expression)
|
void |
setPreMoveExpression(String fileLanguageExpression)
Sets the pre move expression based on FileLanguage |
void |
setPreMoveNamePostfix(String preMoveNamePostfix)
Sets the name postfix appended to pre moved files. |
void |
setPreMoveNamePrefix(String preMoveNamePrefix)
|
Methods inherited from class org.apache.camel.impl.ScheduledPollEndpoint |
---|
configureConsumer, configureProperties, getConsumerProperties, setConsumerProperties |
Methods inherited from class org.apache.camel.impl.DefaultEndpoint |
---|
convertTo, createExchange, createExecutorService, createPollingConsumer, equals, getCamelContext, getComponent, getContext, getEndpointUri, getExchangePattern, getExchangeType, getExecutorService, hashCode, isLenientProperties, setCamelContext, setContext, setEndpointUri, setExchangePattern, setExecutorService, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final transient String DEFAULT_LOCK_FILE_POSTFIX
Constructor Detail |
---|
protected FileEndpoint(File file, String endpointUri, FileComponent component)
public FileEndpoint(String endpointUri, File file)
public FileEndpoint(File file)
public FileEndpoint()
Method Detail |
---|
public Producer<FileExchange> createProducer() throws Exception
Endpoint
Exception
public Consumer<FileExchange> createConsumer(Processor processor) throws Exception
Endpoint
Exception
public FileExchange createExchange(File file)
file
- the file
public FileExchange createExchange()
Endpoint
createExchange
in interface Endpoint<FileExchange>
createExchange
in class DefaultEndpoint<FileExchange>
public FileExchange createExchange(ExchangePattern pattern)
Endpoint
ExchangePattern
such as whether its going
to be an ExchangePattern.InOnly
or ExchangePattern.InOut
exchange
createExchange
in interface Endpoint<FileExchange>
createExchange
in class DefaultEndpoint<FileExchange>
pattern
- the message exchange pattern for the exchangepublic String getGeneratedFileName(Message message)
public void configureMessage(File file, Message message)
FileComponent.HEADER_FILE_NAME
header.
public File getFile()
public void setFile(File file)
public boolean isSingleton()
Endpoint
public boolean isAutoCreate()
public void setAutoCreate(boolean autoCreate)
public FileProcessStrategy getFileStrategy()
public void setFileStrategy(FileProcessStrategy fileProcessStrategy)
fileProcessStrategy
- the new strategy to usepublic boolean isDelete()
public void setDelete(boolean delete)
public boolean isLock()
public void setLock(boolean lock)
public String getMoveNamePostfix()
public void setMoveNamePostfix(String moveNamePostfix)
public String getMoveNamePrefix()
public void setMoveNamePrefix(String moveNamePrefix)
public String[] getExcludedNamePrefixes()
public void setExcludedNamePrefixes(String[] excludedNamePrefixes)
public String[] getExcludedNamePostfixes()
public void setExcludedNamePostfixes(String[] excludedNamePostfixes)
DEFAULT_LOCK_FILE_POSTFIX
to ignore lock files by default.
public String getPreMoveNamePrefix()
public void setPreMoveNamePrefix(String preMoveNamePrefix)
public String getPreMoveNamePostfix()
public void setPreMoveNamePostfix(String preMoveNamePostfix)
public boolean isNoop()
public void setNoop(boolean noop)
FileProcessStrategy
will be to use the
NoOpFileProcessStrategy
to not move or copy processed files
public boolean isAppend()
public void setAppend(boolean append)
public int getBufferSize()
public void setBufferSize(int bufferSize)
public boolean isIgnoreFileNameHeader()
public void setIgnoreFileNameHeader(boolean ignoreFileNameHeader)
FileComponent.HEADER_FILE_NAME
header and generate a new dynamic file
public String getExcludedNamePrefix()
public void setExcludedNamePrefix(String excludedNamePrefix)
public String getExcludedNamePostfix()
public void setExcludedNamePostfix(String excludedNamePostfix)
public Expression getExpression()
public void setExpression(Expression expression)
public void setExpression(String fileLanguageExpression)
FileLanguage
public Expression getPreMoveExpression()
public void setPreMoveExpression(Expression expression)
public void setPreMoveExpression(String fileLanguageExpression)
FileLanguage
protected FileProcessStrategy createFileStrategy()
protected Map<String,Object> getParamsAsMap()
protected String createEndpointUri()
DefaultEndpoint
createEndpointUri
in class DefaultEndpoint<FileExchange>
protected String getFileFriendlyMessageId(String id)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |