public class SimpleSftpClientImpl extends AbstractLoggingBean implements SimpleSftpClient
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(IOFunction<? super SimpleClient,? extends ClientSession> sessionProvider) |
SimpleClient |
getClient() |
SftpClientFactory |
getSftpClientFactory() |
boolean |
isOpen() |
void |
setClient(SimpleClient client) |
void |
setSftpClientFactory(SftpClientFactory sftpClientFactory) |
SftpClient |
sftpLogin(SocketAddress target,
String username,
KeyPair identity)
Creates an SFTP session using the provided credentials
|
SftpClient |
sftpLogin(SocketAddress target,
String username,
String password)
Creates an SFTP session using the provided credentials
|
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warn
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(SocketAddress target, String username, String password) throws IOException
SimpleSftpClient
sftpLogin
in interface SimpleSftpClient
target
- The target SocketAddress
username
- Usernamepassword
- PasswordSftpClient
- Note: closing the client also closes its underlying
sessionIOException
- If failed to login or authenticatepublic SftpClient sftpLogin(SocketAddress target, String username, KeyPair identity) throws IOException
SimpleSftpClient
sftpLogin
in interface SimpleSftpClient
target
- The target SocketAddress
username
- Usernameidentity
- The KeyPair
identitySftpClient
- Note: closing the client also closes its underlying
sessionIOException
- If failed to login or authenticateprotected SftpClient createSftpClient(IOFunction<? super SimpleClient,? extends ClientSession> sessionProvider) throws IOException
IOException
protected SftpClient createSftpClient(ClientSession session) throws IOException
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in interface Channel
IOException
Copyright © 2008–2024 The Apache Software Foundation. All rights reserved.