Class RemoteFileProducer<T>
- java.lang.Object
-
- org.apache.camel.support.service.BaseService
-
- org.apache.camel.support.service.ServiceSupport
-
- org.apache.camel.support.DefaultProducer
-
- org.apache.camel.component.file.GenericFileProducer<T>
-
- org.apache.camel.component.file.remote.RemoteFileProducer<T>
-
- All Implemented Interfaces:
AutoCloseable,org.apache.camel.EndpointAware,org.apache.camel.IsSingleton,org.apache.camel.Processor,org.apache.camel.Producer,org.apache.camel.Service,org.apache.camel.ShutdownableService,org.apache.camel.StatefulService,org.apache.camel.SuspendableService
public class RemoteFileProducer<T> extends org.apache.camel.component.file.GenericFileProducer<T>Generic remote file producer for all the FTP variations.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedRemoteFileProducer(RemoteFileEndpoint<T> endpoint, RemoteFileOperations<T> operations)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidconnectIfNecessary(org.apache.camel.Exchange exchange)voiddisconnect()protected voiddoStart()protected voiddoStop()RemoteFileEndpoint<T>getEndpoint()StringgetFileSeparator()protected RemoteFileOperations<T>getOperations()voidhandleFailedWrite(org.apache.camel.Exchange exchange, Exception exception)The file could not be written.booleanisSingleton()StringnormalizePath(String name)voidpostWriteCheck(org.apache.camel.Exchange exchange)voidpreWriteCheck(org.apache.camel.Exchange exchange)voidprocess(org.apache.camel.Exchange exchange)StringtoString()-
Methods inherited from class org.apache.camel.component.file.GenericFileProducer
createFileName, createTempFileName, processExchange, setOperations, writeFile
-
Methods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doInit, doLifecycleChange, doResume, doShutdown, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Constructor Detail
-
RemoteFileProducer
protected RemoteFileProducer(RemoteFileEndpoint<T> endpoint, RemoteFileOperations<T> operations)
-
-
Method Detail
-
getFileSeparator
public String getFileSeparator()
- Overrides:
getFileSeparatorin classorg.apache.camel.component.file.GenericFileProducer<T>
-
normalizePath
public String normalizePath(String name)
- Overrides:
normalizePathin classorg.apache.camel.component.file.GenericFileProducer<T>
-
process
public void process(org.apache.camel.Exchange exchange) throws Exception
-
getOperations
protected RemoteFileOperations<T> getOperations()
-
getEndpoint
public RemoteFileEndpoint<T> getEndpoint()
- Specified by:
getEndpointin interfaceorg.apache.camel.EndpointAware- Overrides:
getEndpointin classorg.apache.camel.support.DefaultProducer
-
handleFailedWrite
public void handleFailedWrite(org.apache.camel.Exchange exchange, Exception exception) throws ExceptionThe file could not be written. We need to disconnect from the remote server.
-
disconnect
public void disconnect() throws org.apache.camel.component.file.GenericFileOperationFailedException- Throws:
org.apache.camel.component.file.GenericFileOperationFailedException
-
preWriteCheck
public void preWriteCheck(org.apache.camel.Exchange exchange) throws Exception
-
postWriteCheck
public void postWriteCheck(org.apache.camel.Exchange exchange)
- Overrides:
postWriteCheckin classorg.apache.camel.component.file.GenericFileProducer<T>
-
doStart
protected void doStart() throws Exception
-
doStop
protected void doStop() throws Exception
-
connectIfNecessary
protected void connectIfNecessary(org.apache.camel.Exchange exchange) throws org.apache.camel.component.file.GenericFileOperationFailedException- Throws:
org.apache.camel.component.file.GenericFileOperationFailedException
-
isSingleton
public boolean isSingleton()
- Specified by:
isSingletonin interfaceorg.apache.camel.IsSingleton- Overrides:
isSingletonin classorg.apache.camel.support.DefaultProducer
-
toString
public String toString()
- Overrides:
toStringin classorg.apache.camel.support.DefaultProducer
-
-