public class SftpOperations extends Object implements RemoteFileOperations<SftpRemoteFile>
| Modifier and Type | Class and Description |
|---|---|
static interface |
SftpOperations.ExtendedUserInfo
Extended user info which supports interactive keyboard mode, by entering
the password.
|
| Constructor and Description |
|---|
SftpOperations() |
SftpOperations(com.jcraft.jsch.Proxy proxy) |
| 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
|
protected com.jcraft.jsch.Session |
createSession(RemoteFileConfiguration configuration) |
boolean |
deleteFile(String name) |
void |
disconnect()
Disconnects from the remote server
|
boolean |
existsFile(String name) |
protected boolean |
fastExistsFile(String name) |
void |
forceDisconnect()
Forces a hard disconnect from the remote server and cause the client to be re-created on next poll.
|
String |
getCurrentDirectory() |
boolean |
isConnected()
Returns whether we are connected to the remote server or not
|
List<SftpRemoteFile> |
listFiles() |
List<SftpRemoteFile> |
listFiles(String path) |
void |
releaseRetrievedFileResources(org.apache.camel.Exchange exchange) |
boolean |
renameFile(String from,
String to) |
boolean |
retrieveFile(String name,
org.apache.camel.Exchange exchange,
long size) |
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<SftpRemoteFile> endpoint) |
boolean |
storeFile(String name,
org.apache.camel.Exchange exchange,
long size) |
public SftpOperations()
public SftpOperations(com.jcraft.jsch.Proxy proxy)
public void setEndpoint(org.apache.camel.component.file.GenericFileEndpoint<SftpRemoteFile> endpoint)
setEndpoint in interface org.apache.camel.component.file.GenericFileOperations<SftpRemoteFile>public boolean connect(RemoteFileConfiguration configuration) throws org.apache.camel.component.file.GenericFileOperationFailedException
RemoteFileOperationsconnect in interface RemoteFileOperations<SftpRemoteFile>configuration - configurationorg.apache.camel.component.file.GenericFileOperationFailedException - can be thrownprotected com.jcraft.jsch.Session createSession(RemoteFileConfiguration configuration) throws com.jcraft.jsch.JSchException
com.jcraft.jsch.JSchExceptionpublic boolean isConnected()
throws org.apache.camel.component.file.GenericFileOperationFailedException
RemoteFileOperationsisConnected in interface RemoteFileOperations<SftpRemoteFile>org.apache.camel.component.file.GenericFileOperationFailedException - can be thrownpublic void disconnect()
throws org.apache.camel.component.file.GenericFileOperationFailedException
RemoteFileOperationsdisconnect in interface RemoteFileOperations<SftpRemoteFile>org.apache.camel.component.file.GenericFileOperationFailedException - can be thrownpublic void forceDisconnect()
throws org.apache.camel.component.file.GenericFileOperationFailedException
RemoteFileOperationsforceDisconnect in interface RemoteFileOperations<SftpRemoteFile>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<SftpRemoteFile>org.apache.camel.component.file.GenericFileOperationFailedExceptionpublic boolean renameFile(String from, String to) throws org.apache.camel.component.file.GenericFileOperationFailedException
renameFile in interface org.apache.camel.component.file.GenericFileOperations<SftpRemoteFile>org.apache.camel.component.file.GenericFileOperationFailedExceptionpublic boolean buildDirectory(String directory, boolean absolute) throws org.apache.camel.component.file.GenericFileOperationFailedException
buildDirectory in interface org.apache.camel.component.file.GenericFileOperations<SftpRemoteFile>org.apache.camel.component.file.GenericFileOperationFailedExceptionpublic String getCurrentDirectory() throws org.apache.camel.component.file.GenericFileOperationFailedException
getCurrentDirectory in interface org.apache.camel.component.file.GenericFileOperations<SftpRemoteFile>org.apache.camel.component.file.GenericFileOperationFailedExceptionpublic void changeCurrentDirectory(String path) throws org.apache.camel.component.file.GenericFileOperationFailedException
changeCurrentDirectory in interface org.apache.camel.component.file.GenericFileOperations<SftpRemoteFile>org.apache.camel.component.file.GenericFileOperationFailedExceptionpublic void changeToParentDirectory()
throws org.apache.camel.component.file.GenericFileOperationFailedException
changeToParentDirectory in interface org.apache.camel.component.file.GenericFileOperations<SftpRemoteFile>org.apache.camel.component.file.GenericFileOperationFailedExceptionpublic List<SftpRemoteFile> listFiles() throws org.apache.camel.component.file.GenericFileOperationFailedException
listFiles in interface org.apache.camel.component.file.GenericFileOperations<SftpRemoteFile>org.apache.camel.component.file.GenericFileOperationFailedExceptionpublic List<SftpRemoteFile> listFiles(String path) throws org.apache.camel.component.file.GenericFileOperationFailedException
listFiles in interface org.apache.camel.component.file.GenericFileOperations<SftpRemoteFile>org.apache.camel.component.file.GenericFileOperationFailedExceptionpublic boolean retrieveFile(String name, org.apache.camel.Exchange exchange, long size) throws org.apache.camel.component.file.GenericFileOperationFailedException
retrieveFile in interface org.apache.camel.component.file.GenericFileOperations<SftpRemoteFile>org.apache.camel.component.file.GenericFileOperationFailedExceptionpublic void releaseRetrievedFileResources(org.apache.camel.Exchange exchange)
throws org.apache.camel.component.file.GenericFileOperationFailedException
releaseRetrievedFileResources in interface org.apache.camel.component.file.GenericFileOperations<SftpRemoteFile>org.apache.camel.component.file.GenericFileOperationFailedExceptionpublic boolean storeFile(String name, org.apache.camel.Exchange exchange, long size) throws org.apache.camel.component.file.GenericFileOperationFailedException
storeFile in interface org.apache.camel.component.file.GenericFileOperations<SftpRemoteFile>org.apache.camel.component.file.GenericFileOperationFailedExceptionpublic boolean existsFile(String name) throws org.apache.camel.component.file.GenericFileOperationFailedException
existsFile in interface org.apache.camel.component.file.GenericFileOperations<SftpRemoteFile>org.apache.camel.component.file.GenericFileOperationFailedExceptionprotected boolean fastExistsFile(String name) throws org.apache.camel.component.file.GenericFileOperationFailedException
org.apache.camel.component.file.GenericFileOperationFailedExceptionpublic boolean sendNoop()
throws org.apache.camel.component.file.GenericFileOperationFailedException
RemoteFileOperationssendNoop in interface RemoteFileOperations<SftpRemoteFile>org.apache.camel.component.file.GenericFileOperationFailedException - can be thrownpublic boolean sendSiteCommand(String command) throws org.apache.camel.component.file.GenericFileOperationFailedException
RemoteFileOperationssendSiteCommand in interface RemoteFileOperations<SftpRemoteFile>command - the commandorg.apache.camel.component.file.GenericFileOperationFailedException - can be thrownApache Camel