public abstract class RemoteFileConfiguration
extends org.apache.camel.component.file.GenericFileConfiguration
Modifier and Type | Class and Description |
---|---|
static class |
RemoteFileConfiguration.PathSeparator
Path separator as either unix or windows style.
|
Constructor and Description |
---|
RemoteFileConfiguration() |
RemoteFileConfiguration(URI uri) |
Modifier and Type | Method and Description |
---|---|
void |
configure(URI uri) |
int |
getConnectTimeout() |
String |
getDirectoryName() |
String |
getHost() |
String |
getPassword() |
int |
getPort() |
String |
getProtocol() |
int |
getReceiveBufferSize() |
RemoteFileConfiguration.PathSeparator |
getSeparator() |
String |
getSiteCommand() |
int |
getSoTimeout() |
int |
getTimeout() |
String |
getUsername() |
boolean |
isBinary() |
boolean |
isIgnoreFileNotFoundOrPermissionError() |
boolean |
isPassiveMode() |
boolean |
isSendNoop() |
boolean |
isStepwise() |
boolean |
isStreamDownload() |
boolean |
isThrowExceptionOnConnectFailed() |
boolean |
isUseList() |
boolean |
needToNormalize() |
String |
normalizePath(String path)
Normalizes the given path according to the configured path separator.
|
String |
remoteServerInformation()
Returns human readable server information for logging purpose
|
void |
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 established
Used by both FTPClient and JSCH |
protected abstract void |
setDefaultPort() |
void |
setDirectoryName(String directoryName)
The starting directory
|
void |
setHost(String host)
Hostname of the FTP server
|
void |
setIgnoreFileNotFoundOrPermissionError(boolean ignoreFileNotFoundOrPermissionError)
Whether to ignore when trying to download 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 login
|
void |
setPort(int port)
Port of the FTP server
|
void |
setProtocol(String protocol)
The ftp protocol to use
|
void |
setReceiveBufferSize(int receiveBufferSize)
The receive (download) buffer size
Used only by FTPClient |
void |
setSendNoop(boolean sendNoop)
Whether to send a noop command as a pre-write check before uploading files to the FTP server.
|
void |
setSeparator(RemoteFileConfiguration.PathSeparator separator)
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 timeout
Used only by FTPClient |
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.
|
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)
By default exception is not thrown and a WARN is logged. |
void |
setTimeout(int timeout)
Sets the data timeout for waiting for reply
Used only by FTPClient |
void |
setUseList(boolean useList)
Whether to allow using LIST command when downloading a file.
|
void |
setUsername(String username)
Username to use for login
|
public RemoteFileConfiguration()
public RemoteFileConfiguration(URI uri)
public boolean needToNormalize()
needToNormalize
in class org.apache.camel.component.file.GenericFileConfiguration
public void configure(URI uri)
configure
in class org.apache.camel.component.file.GenericFileConfiguration
public String remoteServerInformation()
protected abstract void setDefaultPort()
public String getHost()
public void setHost(String host)
public int getPort()
public void setPort(int port)
public String getPassword()
public void setPassword(String password)
public String getProtocol()
public void setProtocol(String protocol)
public String getUsername()
public void setUsername(String username)
public String getDirectoryName()
public void setDirectoryName(String directoryName)
public boolean isBinary()
public void setBinary(boolean binary)
public boolean isPassiveMode()
public void setPassiveMode(boolean passiveMode)
public int getConnectTimeout()
public void setConnectTimeout(int connectTimeout)
Used by both FTPClient and JSCH
public int getTimeout()
public void setTimeout(int timeout)
Used only by FTPClient
public int getSoTimeout()
public void setSoTimeout(int soTimeout)
Used only by FTPClient
public int getReceiveBufferSize()
public void setReceiveBufferSize(int receiveBufferSize)
Used only by FTPClient
public boolean isThrowExceptionOnConnectFailed()
public void setThrowExceptionOnConnectFailed(boolean throwExceptionOnConnectFailed)
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 the PollingConsumerPollStrategy
rollback method.
public String getSiteCommand()
public void setSiteCommand(String siteCommand)
Multiple site commands can be separated using a new line character (\n).
siteCommand
- the site command(s).public boolean isStepwise()
public void setStepwise(boolean stepwise)
You can disable this if you for example are in a situation where you cannot change directory on the FTP server due security reasons.
stepwise
- whether to use change directory or notpublic RemoteFileConfiguration.PathSeparator getSeparator()
public void setSeparator(RemoteFileConfiguration.PathSeparator separator)
UNIX = Uses unix style path separator Windows = Uses windows style path separator Auto = (is default) Use existing path separator in file name
public boolean isStreamDownload()
public void setStreamDownload(boolean streamDownload)
public boolean isUseList()
public void setUseList(boolean useList)
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.
public boolean isIgnoreFileNotFoundOrPermissionError()
public void setIgnoreFileNotFoundOrPermissionError(boolean ignoreFileNotFoundOrPermissionError)
By default when a file does not exists or insufficient permission, then an exception is thrown. Setting this option to true allows to ignore that instead.
public boolean isSendNoop()
public void setSendNoop(boolean sendNoop)
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.
Apache Camel