public class FtpOperations extends Object implements RemoteFileOperations<org.apache.commons.net.ftp.FTPFile>
Modifier and Type | Field and Description |
---|---|
protected org.apache.commons.net.ftp.FTPClient |
client |
protected org.apache.commons.net.ftp.FTPClientConfig |
clientConfig |
protected RemoteFileEndpoint<org.apache.commons.net.ftp.FTPFile> |
endpoint |
protected org.slf4j.Logger |
log |
Constructor and Description |
---|
FtpOperations(org.apache.commons.net.ftp.FTPClient client,
org.apache.commons.net.ftp.FTPClientConfig clientConfig) |
Modifier and Type | Method and Description |
---|---|
boolean |
buildDirectory(String directory,
boolean absolute) |
void |
changeCurrentDirectory(String path) |
void |
changeToParentDirectory() |
boolean |
connect(RemoteFileConfiguration configuration)
Connects to the remote server
|
boolean |
deleteFile(String name) |
void |
disconnect()
Disconnects from the remote server
|
boolean |
existsFile(String name) |
protected boolean |
fastExistsFile(String name) |
String |
getCurrentDirectory() |
protected org.apache.commons.net.ftp.FTPClient |
getFtpClient() |
boolean |
isConnected()
Returns whether we are connected to the remote server or not
|
List<org.apache.commons.net.ftp.FTPFile> |
listFiles() |
List<org.apache.commons.net.ftp.FTPFile> |
listFiles(String path) |
void |
releaseRetreivedFileResources(org.apache.camel.Exchange exchange) |
boolean |
renameFile(String from,
String to) |
boolean |
retrieveFile(String name,
org.apache.camel.Exchange exchange) |
boolean |
sendNoop()
Sends a noop command to the remote server
|
boolean |
sendSiteCommand(String command)
Sends a site command to the remote server
|
void |
setEndpoint(org.apache.camel.component.file.GenericFileEndpoint<org.apache.commons.net.ftp.FTPFile> endpoint) |
boolean |
storeFile(String name,
org.apache.camel.Exchange exchange) |
protected final org.slf4j.Logger log
protected final org.apache.commons.net.ftp.FTPClient client
protected final org.apache.commons.net.ftp.FTPClientConfig clientConfig
protected RemoteFileEndpoint<org.apache.commons.net.ftp.FTPFile> endpoint
public FtpOperations(org.apache.commons.net.ftp.FTPClient client, org.apache.commons.net.ftp.FTPClientConfig clientConfig)
public void setEndpoint(org.apache.camel.component.file.GenericFileEndpoint<org.apache.commons.net.ftp.FTPFile> endpoint)
setEndpoint
in interface org.apache.camel.component.file.GenericFileOperations<org.apache.commons.net.ftp.FTPFile>
public boolean connect(RemoteFileConfiguration configuration) throws org.apache.camel.component.file.GenericFileOperationFailedException
RemoteFileOperations
connect
in interface RemoteFileOperations<org.apache.commons.net.ftp.FTPFile>
configuration
- configurationorg.apache.camel.component.file.GenericFileOperationFailedException
- can be thrownpublic boolean isConnected() throws org.apache.camel.component.file.GenericFileOperationFailedException
RemoteFileOperations
isConnected
in interface RemoteFileOperations<org.apache.commons.net.ftp.FTPFile>
org.apache.camel.component.file.GenericFileOperationFailedException
- can be thrownpublic void disconnect() throws org.apache.camel.component.file.GenericFileOperationFailedException
RemoteFileOperations
disconnect
in interface RemoteFileOperations<org.apache.commons.net.ftp.FTPFile>
org.apache.camel.component.file.GenericFileOperationFailedException
- can be thrownpublic boolean deleteFile(String name) throws org.apache.camel.component.file.GenericFileOperationFailedException
deleteFile
in interface org.apache.camel.component.file.GenericFileOperations<org.apache.commons.net.ftp.FTPFile>
org.apache.camel.component.file.GenericFileOperationFailedException
public boolean renameFile(String from, String to) throws org.apache.camel.component.file.GenericFileOperationFailedException
renameFile
in interface org.apache.camel.component.file.GenericFileOperations<org.apache.commons.net.ftp.FTPFile>
org.apache.camel.component.file.GenericFileOperationFailedException
public boolean buildDirectory(String directory, boolean absolute) throws org.apache.camel.component.file.GenericFileOperationFailedException
buildDirectory
in interface org.apache.camel.component.file.GenericFileOperations<org.apache.commons.net.ftp.FTPFile>
org.apache.camel.component.file.GenericFileOperationFailedException
public boolean retrieveFile(String name, org.apache.camel.Exchange exchange) throws org.apache.camel.component.file.GenericFileOperationFailedException
retrieveFile
in interface org.apache.camel.component.file.GenericFileOperations<org.apache.commons.net.ftp.FTPFile>
org.apache.camel.component.file.GenericFileOperationFailedException
public void releaseRetreivedFileResources(org.apache.camel.Exchange exchange) throws org.apache.camel.component.file.GenericFileOperationFailedException
releaseRetreivedFileResources
in interface org.apache.camel.component.file.GenericFileOperations<org.apache.commons.net.ftp.FTPFile>
org.apache.camel.component.file.GenericFileOperationFailedException
public boolean storeFile(String name, org.apache.camel.Exchange exchange) throws org.apache.camel.component.file.GenericFileOperationFailedException
storeFile
in interface org.apache.camel.component.file.GenericFileOperations<org.apache.commons.net.ftp.FTPFile>
org.apache.camel.component.file.GenericFileOperationFailedException
public boolean existsFile(String name) throws org.apache.camel.component.file.GenericFileOperationFailedException
existsFile
in interface org.apache.camel.component.file.GenericFileOperations<org.apache.commons.net.ftp.FTPFile>
org.apache.camel.component.file.GenericFileOperationFailedException
protected boolean fastExistsFile(String name) throws org.apache.camel.component.file.GenericFileOperationFailedException
org.apache.camel.component.file.GenericFileOperationFailedException
public String getCurrentDirectory() throws org.apache.camel.component.file.GenericFileOperationFailedException
getCurrentDirectory
in interface org.apache.camel.component.file.GenericFileOperations<org.apache.commons.net.ftp.FTPFile>
org.apache.camel.component.file.GenericFileOperationFailedException
public void changeCurrentDirectory(String path) throws org.apache.camel.component.file.GenericFileOperationFailedException
changeCurrentDirectory
in interface org.apache.camel.component.file.GenericFileOperations<org.apache.commons.net.ftp.FTPFile>
org.apache.camel.component.file.GenericFileOperationFailedException
public void changeToParentDirectory() throws org.apache.camel.component.file.GenericFileOperationFailedException
changeToParentDirectory
in interface org.apache.camel.component.file.GenericFileOperations<org.apache.commons.net.ftp.FTPFile>
org.apache.camel.component.file.GenericFileOperationFailedException
public List<org.apache.commons.net.ftp.FTPFile> listFiles() throws org.apache.camel.component.file.GenericFileOperationFailedException
listFiles
in interface org.apache.camel.component.file.GenericFileOperations<org.apache.commons.net.ftp.FTPFile>
org.apache.camel.component.file.GenericFileOperationFailedException
public List<org.apache.commons.net.ftp.FTPFile> listFiles(String path) throws org.apache.camel.component.file.GenericFileOperationFailedException
listFiles
in interface org.apache.camel.component.file.GenericFileOperations<org.apache.commons.net.ftp.FTPFile>
org.apache.camel.component.file.GenericFileOperationFailedException
public boolean sendNoop() throws org.apache.camel.component.file.GenericFileOperationFailedException
RemoteFileOperations
sendNoop
in interface RemoteFileOperations<org.apache.commons.net.ftp.FTPFile>
org.apache.camel.component.file.GenericFileOperationFailedException
- can be thrownpublic boolean sendSiteCommand(String command) throws org.apache.camel.component.file.GenericFileOperationFailedException
RemoteFileOperations
sendSiteCommand
in interface RemoteFileOperations<org.apache.commons.net.ftp.FTPFile>
command
- the commandorg.apache.camel.component.file.GenericFileOperationFailedException
- can be thrownprotected org.apache.commons.net.ftp.FTPClient getFtpClient()
Apache Camel