|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.camel.component.file.remote.FtpOperations
public class FtpOperations
FTP remote file operations
| Field Summary | |
|---|---|
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 Summary | |
|---|---|
FtpOperations(org.apache.commons.net.ftp.FTPClient client,
org.apache.commons.net.ftp.FTPClientConfig clientConfig)
|
|
| Method Summary | |
|---|---|
boolean |
buildDirectory(String directory,
boolean absolute)
Builds the directory structure. |
void |
changeCurrentDirectory(String path)
Change the current remote directory |
void |
changeToParentDirectory()
Change the current remote directory to the parent |
boolean |
connect(RemoteFileConfiguration configuration)
Connects to the remote server |
boolean |
deleteFile(String name)
Deletes the file name by name, relative to the current directory |
void |
disconnect()
Disconnects from the remote server |
boolean |
existsFile(String name)
Determines whether the files exists or not |
String |
getCurrentDirectory()
Gets the current remote directory |
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 the files in the current directory |
List<org.apache.commons.net.ftp.FTPFile> |
listFiles(String path)
List the files in the given remote directory |
boolean |
renameFile(String from,
String to)
Renames the file |
boolean |
retrieveFile(String name,
Exchange exchange)
Retrieves the file |
boolean |
sendNoop()
Sends a noop command to the remote server |
boolean |
sendSiteCommand(String command)
Sends a site command to the remote server |
void |
setEndpoint(GenericFileEndpoint<org.apache.commons.net.ftp.FTPFile> endpoint)
Sets the endpoint as some implementations need access to the endpoint and how its configured. |
boolean |
storeFile(String name,
Exchange exchange)
Stores the content as a new remote file (upload) |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final transient 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
| Constructor Detail |
|---|
public FtpOperations(org.apache.commons.net.ftp.FTPClient client,
org.apache.commons.net.ftp.FTPClientConfig clientConfig)
| Method Detail |
|---|
public void setEndpoint(GenericFileEndpoint<org.apache.commons.net.ftp.FTPFile> endpoint)
GenericFileOperations
setEndpoint in interface GenericFileOperations<org.apache.commons.net.ftp.FTPFile>endpoint - the endpoint
public boolean connect(RemoteFileConfiguration configuration)
throws GenericFileOperationFailedException
RemoteFileOperations
connect in interface RemoteFileOperations<org.apache.commons.net.ftp.FTPFile>configuration - configuration
GenericFileOperationFailedException - can be thrown
public boolean isConnected()
throws GenericFileOperationFailedException
RemoteFileOperations
isConnected in interface RemoteFileOperations<org.apache.commons.net.ftp.FTPFile>GenericFileOperationFailedException - can be thrown
public void disconnect()
throws GenericFileOperationFailedException
RemoteFileOperations
disconnect in interface RemoteFileOperations<org.apache.commons.net.ftp.FTPFile>GenericFileOperationFailedException - can be thrown
public boolean deleteFile(String name)
throws GenericFileOperationFailedException
GenericFileOperations
deleteFile in interface GenericFileOperations<org.apache.commons.net.ftp.FTPFile>name - name of the file
GenericFileOperationFailedException - can be thrown
public boolean renameFile(String from,
String to)
throws GenericFileOperationFailedException
GenericFileOperations
renameFile in interface GenericFileOperations<org.apache.commons.net.ftp.FTPFile>from - original nameto - the new name
GenericFileOperationFailedException - can be thrown
public boolean buildDirectory(String directory,
boolean absolute)
throws GenericFileOperationFailedException
GenericFileOperations
buildDirectory in interface GenericFileOperations<org.apache.commons.net.ftp.FTPFile>directory - the directory path to build as a relative string nameabsolute - wether the directory is an absolute or relative path
GenericFileOperationFailedException - can be thrown
public boolean retrieveFile(String name,
Exchange exchange)
throws GenericFileOperationFailedException
GenericFileOperations
retrieveFile in interface GenericFileOperations<org.apache.commons.net.ftp.FTPFile>name - name of the fileexchange - stream to write the content of the file into
GenericFileOperationFailedException - can be thrown
public boolean storeFile(String name,
Exchange exchange)
throws GenericFileOperationFailedException
GenericFileOperations
storeFile in interface GenericFileOperations<org.apache.commons.net.ftp.FTPFile>name - name of new fileexchange - with the content content of the file
GenericFileOperationFailedException - can be thrown
public boolean existsFile(String name)
throws GenericFileOperationFailedException
GenericFileOperations
existsFile in interface GenericFileOperations<org.apache.commons.net.ftp.FTPFile>name - name of the file
GenericFileOperationFailedException - can be thrown
public String getCurrentDirectory()
throws GenericFileOperationFailedException
GenericFileOperations
getCurrentDirectory in interface GenericFileOperations<org.apache.commons.net.ftp.FTPFile>GenericFileOperationFailedException - can be thrown
public void changeCurrentDirectory(String path)
throws GenericFileOperationFailedException
GenericFileOperations
changeCurrentDirectory in interface GenericFileOperations<org.apache.commons.net.ftp.FTPFile>path - the path to change to
GenericFileOperationFailedException - can be thrown
public void changeToParentDirectory()
throws GenericFileOperationFailedException
GenericFileOperations
changeToParentDirectory in interface GenericFileOperations<org.apache.commons.net.ftp.FTPFile>GenericFileOperationFailedException - can be thrown
public List<org.apache.commons.net.ftp.FTPFile> listFiles()
throws GenericFileOperationFailedException
GenericFileOperations
listFiles in interface GenericFileOperations<org.apache.commons.net.ftp.FTPFile>GenericFileOperationFailedException - can be thrown
public List<org.apache.commons.net.ftp.FTPFile> listFiles(String path)
throws GenericFileOperationFailedException
GenericFileOperations
listFiles in interface GenericFileOperations<org.apache.commons.net.ftp.FTPFile>path - the remote directory
GenericFileOperationFailedException - can be thrown
public boolean sendNoop()
throws GenericFileOperationFailedException
RemoteFileOperations
sendNoop in interface RemoteFileOperations<org.apache.commons.net.ftp.FTPFile>GenericFileOperationFailedException - can be thrown
public boolean sendSiteCommand(String command)
throws GenericFileOperationFailedException
RemoteFileOperations
sendSiteCommand in interface RemoteFileOperations<org.apache.commons.net.ftp.FTPFile>command - the command
GenericFileOperationFailedException - can be thrownprotected org.apache.commons.net.ftp.FTPClient getFtpClient()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||