Class RemoteFileConfiguration
java.lang.Object
org.apache.camel.component.file.GenericFileConfiguration
org.apache.camel.component.file.remote.RemoteFileConfiguration
- Direct Known Subclasses:
FtpConfiguration
,SftpConfiguration
public abstract class RemoteFileConfiguration
extends org.apache.camel.component.file.GenericFileConfiguration
Configuration of the FTP server
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Path separator as either unix or windows style. -
Field Summary
Fields inherited from class org.apache.camel.component.file.GenericFileConfiguration
directory
-
Constructor Summary
ModifierConstructorDescriptionprotected
protected
-
Method Summary
Modifier and TypeMethodDescriptionvoid
int
getHost()
int
getPort()
int
int
boolean
isBinary()
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
normalizePath
(String path) Normalizes the given path according to the configured path separator.Returns human readable server information for logging purposevoid
setBinary
(boolean binary) Specifies the file transfer mode, BINARY or ASCII.void
setConnectTimeout
(int connectTimeout) Sets the connect timeout for waiting for a connection to be establishedprotected abstract void
void
setDirectoryName
(String directoryName) The starting directoryvoid
Hostname of the FTP servervoid
setIgnoreFileNotFoundOrPermissionError
(boolean ignoreFileNotFoundOrPermissionError) Whether to ignore when (trying to list files in directories or when downloading a file), which does not exist or due to permission error.void
setPassiveMode
(boolean passiveMode) Sets passive mode connections.void
setPassword
(String password) Password to use for loginvoid
setPort
(int port) Port of the FTP servervoid
setProtocol
(String protocol) The ftp protocol to usevoid
setSendNoop
(boolean sendNoop) Whether to send a noop command as a pre-write check before uploading files to the FTP server.void
Sets the path separator to be used.void
setSiteCommand
(String siteCommand) Sets optional site command(s) to be executed after successful login.void
setSoTimeout
(int soTimeout) Sets the so timeoutvoid
setStepwise
(boolean stepwise) Sets whether we should stepwise change directories while traversing file structures when downloading files, or as well when uploading a file to a directory.void
setStreamDownload
(boolean streamDownload) Sets the download method to use when not using a local working directory.void
setThrowExceptionOnConnectFailed
(boolean throwExceptionOnConnectFailed) Should an exception be thrown if connection failed (exhausted)void
setTimeout
(int timeout) Sets the data timeout for waiting for replyvoid
setUseList
(boolean useList) Whether to allow using LIST command when downloading a file.void
setUsername
(String username) Username to use for loginMethods inherited from class org.apache.camel.component.file.GenericFileConfiguration
getDirectory, setDirectory, toString
-
Constructor Details
-
RemoteFileConfiguration
protected RemoteFileConfiguration() -
RemoteFileConfiguration
-
-
Method Details
-
needToNormalize
public boolean needToNormalize()- Overrides:
needToNormalize
in classorg.apache.camel.component.file.GenericFileConfiguration
-
configure
- Overrides:
configure
in classorg.apache.camel.component.file.GenericFileConfiguration
-
remoteServerInformation
Returns human readable server information for logging purpose -
setDefaultPort
protected abstract void setDefaultPort() -
getHost
-
setHost
Hostname of the FTP server -
getPort
public int getPort() -
setPort
public void setPort(int port) Port of the FTP server -
getPassword
-
setPassword
Password to use for login -
getProtocol
-
setProtocol
The ftp protocol to use -
getUsername
-
setUsername
Username to use for login -
getDirectoryName
-
setDirectoryName
The starting directory -
isBinary
public boolean isBinary() -
setBinary
public void setBinary(boolean binary) Specifies the file transfer mode, BINARY or ASCII. Default is ASCII (false). -
isPassiveMode
public boolean isPassiveMode() -
setPassiveMode
public void setPassiveMode(boolean passiveMode) Sets passive mode connections.
Default is active mode connections. -
getConnectTimeout
public int getConnectTimeout() -
setConnectTimeout
public void setConnectTimeout(int connectTimeout) Sets the connect timeout for waiting for a connection to be established Used by both FTPClient and JSCH -
getTimeout
public int getTimeout() -
setTimeout
public void setTimeout(int timeout) Sets the data timeout for waiting for reply Used only by FTPClient -
getSoTimeout
public int getSoTimeout() -
setSoTimeout
public void setSoTimeout(int soTimeout) Sets the so timeout FTP and FTPS Only for Camel 2.4. SFTP for Camel 2.14.3/2.15.3/2.16 onwards. Is the SocketOptions.SO_TIMEOUT value in millis. Recommended option is to set this to 300000 so as not have a hanged connection. On SFTP this option is set as timeout on the JSCH Session instance. -
isThrowExceptionOnConnectFailed
public boolean isThrowExceptionOnConnectFailed() -
setThrowExceptionOnConnectFailed
public void setThrowExceptionOnConnectFailed(boolean throwExceptionOnConnectFailed) Should an exception be thrown if connection failed (exhausted) By default exception is not thrown and a WARN is logged. You can use this to enable exception being thrown and handle the thrown exception from thePollingConsumerPollStrategy
rollback method. -
getSiteCommand
-
setSiteCommand
Sets optional site command(s) to be executed after successful login. Multiple site commands can be separated using a new line character. -
isStepwise
public boolean isStepwise() -
setStepwise
public void setStepwise(boolean stepwise) Sets whether we should stepwise change directories while traversing file structures when downloading files, or as well when uploading a file to a directory. You can disable this if you for example are in a situation where you cannot change directory on the FTP server due security reasons.- Parameters:
stepwise
- whether to use change directory or not
-
getSeparator
-
setSeparator
Sets the path separator to be used. UNIX = Uses unix style path separator Windows = Uses windows style path separator Auto = (is default) Use existing path separator in file name -
isStreamDownload
public boolean isStreamDownload() -
setStreamDownload
public void setStreamDownload(boolean streamDownload) Sets the download method to use when not using a local working directory. If set to true, the remote files are streamed to the route as they are read. When set to false, the remote files are loaded into memory before being sent into the route. -
isUseList
public boolean isUseList() -
setUseList
public void setUseList(boolean useList) Whether to allow using LIST command when downloading a file. Default is true. In some use cases you may want to download a specific file and are not allowed to use the LIST command, and therefore you can set this option to false. Notice when using this option, then the specific file to download does not include meta-data information such as file size, timestamp, permissions etc, because those information is only possible to retrieve when LIST command is in use. -
isIgnoreFileNotFoundOrPermissionError
public boolean isIgnoreFileNotFoundOrPermissionError() -
setIgnoreFileNotFoundOrPermissionError
public void setIgnoreFileNotFoundOrPermissionError(boolean ignoreFileNotFoundOrPermissionError) Whether to ignore when (trying to list files in directories or when downloading a file), which does not exist or due to permission error. By default when a directory or file does not exists or insufficient permission, then an exception is thrown. Setting this option to true allows to ignore that instead. -
isSendNoop
public boolean isSendNoop() -
setSendNoop
public void setSendNoop(boolean sendNoop) Whether to send a noop command as a pre-write check before uploading files to the FTP server. This is enabled by default as a validation of the connection is still valid, which allows to silently re-connect to be able to upload the file. However if this causes problems, you can turn this option off. -
normalizePath
Normalizes the given path according to the configured path separator.- Parameters:
path
- the given path- Returns:
- the normalized path
-