public class SimpleSftpClientImpl extends AbstractLoggingBean implements SimpleSftpClient
| Modifier and Type | Field and Description |
|---|---|
private SimpleClient |
clientInstance |
private SftpClientFactory |
sftpClientFactory |
log| Constructor and Description |
|---|
SimpleSftpClientImpl() |
SimpleSftpClientImpl(SimpleClient client) |
SimpleSftpClientImpl(SimpleClient client,
SftpClientFactory sftpClientFactory) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected SftpClient |
createSftpClient(ClientSession session) |
protected SftpClient |
createSftpClient(ClientSession session,
SftpClient client) |
protected SftpClient |
createSftpClient(IOFunction<? super SimpleClient,? extends ClientSession> sessionProvider) |
SimpleClient |
getClient() |
SftpClientFactory |
getSftpClientFactory() |
boolean |
isOpen() |
void |
setClient(SimpleClient client) |
void |
setSftpClientFactory(SftpClientFactory sftpClientFactory) |
SftpClient |
sftpLogin(java.net.SocketAddress target,
java.lang.String username,
java.security.KeyPair identity)
Creates an SFTP session using the provided credentials
|
SftpClient |
sftpLogin(java.net.SocketAddress target,
java.lang.String username,
java.lang.String password)
Creates an SFTP session using the provided credentials
|
getSimplifiedLoggerprivate SimpleClient clientInstance
private SftpClientFactory sftpClientFactory
public SimpleSftpClientImpl()
public SimpleSftpClientImpl(SimpleClient client)
public SimpleSftpClientImpl(SimpleClient client, SftpClientFactory sftpClientFactory)
public SimpleClient getClient()
public void setClient(SimpleClient client)
public SftpClientFactory getSftpClientFactory()
public void setSftpClientFactory(SftpClientFactory sftpClientFactory)
public SftpClient sftpLogin(java.net.SocketAddress target, java.lang.String username, java.lang.String password) throws java.io.IOException
SimpleSftpClientsftpLogin in interface SimpleSftpClienttarget - The target SocketAddressusername - Usernamepassword - PasswordSftpClient - Note: closing the client also closes its underlying
sessionjava.io.IOException - If failed to login or authenticatepublic SftpClient sftpLogin(java.net.SocketAddress target, java.lang.String username, java.security.KeyPair identity) throws java.io.IOException
SimpleSftpClientsftpLogin in interface SimpleSftpClienttarget - The target SocketAddressusername - Usernameidentity - The KeyPair identitySftpClient - Note: closing the client also closes its underlying
sessionjava.io.IOException - If failed to login or authenticateprotected SftpClient createSftpClient(IOFunction<? super SimpleClient,? extends ClientSession> sessionProvider) throws java.io.IOException
java.io.IOExceptionprotected SftpClient createSftpClient(ClientSession session) throws java.io.IOException
java.io.IOExceptionprotected SftpClient createSftpClient(ClientSession session, SftpClient client) throws java.io.IOException
java.io.IOExceptionpublic boolean isOpen()
isOpen in interface java.nio.channels.Channelpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in interface java.nio.channels.Channeljava.io.IOException