public class GenericFileProducer<T>
extends org.apache.camel.support.DefaultProducer
Modifier and Type | Field and Description |
---|---|
protected GenericFileEndpoint<T> |
endpoint |
protected org.slf4j.Logger |
log |
protected GenericFileOperations<T> |
operations |
Modifier | Constructor and Description |
---|---|
protected |
GenericFileProducer(GenericFileEndpoint<T> endpoint,
GenericFileOperations<T> operations) |
Modifier and Type | Method and Description |
---|---|
String |
createFileName(org.apache.camel.Exchange exchange) |
String |
createTempFileName(org.apache.camel.Exchange exchange,
String fileName) |
protected void |
doStart() |
protected void |
doStop() |
String |
getFileSeparator() |
void |
handleFailedWrite(org.apache.camel.Exchange exchange,
Exception exception)
If we fail writing out a file, we will call this method.
|
String |
normalizePath(String name) |
void |
postWriteCheck(org.apache.camel.Exchange exchange)
Perform any actions that need to occur after we are done such as disconnecting.
|
void |
preWriteCheck(org.apache.camel.Exchange exchange)
Perform any actions that need to occur before we write such as connecting to an FTP server etc.
|
void |
process(org.apache.camel.Exchange exchange) |
protected void |
processExchange(org.apache.camel.Exchange exchange,
String target)
Perform the work to process the fileExchange
|
void |
setOperations(GenericFileOperations<T> operations)
Sets the operations to be used.
|
void |
writeFile(org.apache.camel.Exchange exchange,
String fileName) |
createExchange, getEndpoint, isSingleton, toString
build, doBuild, doInit, doResume, doShutdown, doSuspend, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
protected final org.slf4j.Logger log
protected final GenericFileEndpoint<T> endpoint
protected GenericFileOperations<T> operations
protected GenericFileProducer(GenericFileEndpoint<T> endpoint, GenericFileOperations<T> operations)
public String getFileSeparator()
public void setOperations(GenericFileOperations<T> operations)
operations
- the operationsprotected void processExchange(org.apache.camel.Exchange exchange, String target) throws Exception
exchange
- fileExchangetarget
- the target filenameException
- is thrown if some errorpublic void handleFailedWrite(org.apache.camel.Exchange exchange, Exception exception) throws Exception
Exception
public void preWriteCheck(org.apache.camel.Exchange exchange) throws Exception
Exception
public void postWriteCheck(org.apache.camel.Exchange exchange)
public void writeFile(org.apache.camel.Exchange exchange, String fileName) throws GenericFileOperationFailedException
public String createFileName(org.apache.camel.Exchange exchange)
public String createTempFileName(org.apache.camel.Exchange exchange, String fileName)
protected void doStart() throws Exception
doStart
in class org.apache.camel.support.DefaultProducer
Exception
Apache Camel