Package org.apache.sshd.sftp.client.impl
Class SimpleSftpClientImpl
java.lang.Object
org.apache.sshd.common.util.logging.AbstractLoggingBean
org.apache.sshd.sftp.client.impl.SimpleSftpClientImpl
- All Implemented Interfaces:
Closeable,AutoCloseable,Channel,SimpleSftpClient
public class SimpleSftpClientImpl
extends org.apache.sshd.common.util.logging.AbstractLoggingBean
implements SimpleSftpClient
- Author:
- Apache MINA SSHD Project
-
Field Summary
Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
log -
Constructor Summary
ConstructorsConstructorDescriptionSimpleSftpClientImpl(org.apache.sshd.client.simple.SimpleClient client) SimpleSftpClientImpl(org.apache.sshd.client.simple.SimpleClient client, SftpClientFactory sftpClientFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected SftpClientcreateSftpClient(org.apache.sshd.client.session.ClientSession session) protected SftpClientcreateSftpClient(org.apache.sshd.common.util.io.functors.IOFunction<? super org.apache.sshd.client.simple.SimpleClient, ? extends org.apache.sshd.client.session.ClientSession> sessionProvider) org.apache.sshd.client.simple.SimpleClientbooleanisOpen()voidsetClient(org.apache.sshd.client.simple.SimpleClient client) voidsetSftpClientFactory(SftpClientFactory sftpClientFactory) sftpLogin(SocketAddress target, String username, String password) Creates an SFTP session using the provided credentialssftpLogin(SocketAddress target, String username, KeyPair identity) Creates an SFTP session using the provided credentialsMethods inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warn
-
Constructor Details
-
SimpleSftpClientImpl
public SimpleSftpClientImpl() -
SimpleSftpClientImpl
public SimpleSftpClientImpl(org.apache.sshd.client.simple.SimpleClient client) -
SimpleSftpClientImpl
public SimpleSftpClientImpl(org.apache.sshd.client.simple.SimpleClient client, SftpClientFactory sftpClientFactory)
-
-
Method Details
-
getClient
public org.apache.sshd.client.simple.SimpleClient getClient() -
setClient
public void setClient(org.apache.sshd.client.simple.SimpleClient client) -
getSftpClientFactory
-
setSftpClientFactory
-
sftpLogin
public SftpClient sftpLogin(SocketAddress target, String username, String password) throws IOException Description copied from interface:SimpleSftpClientCreates an SFTP session using the provided credentials- Specified by:
sftpLoginin interfaceSimpleSftpClient- Parameters:
target- The targetSocketAddressusername- Usernamepassword- Password- Returns:
- Created
SftpClient- Note: closing the client also closes its underlying session - Throws:
IOException- If failed to login or authenticate
-
sftpLogin
public SftpClient sftpLogin(SocketAddress target, String username, KeyPair identity) throws IOException Description copied from interface:SimpleSftpClientCreates an SFTP session using the provided credentials- Specified by:
sftpLoginin interfaceSimpleSftpClient- Parameters:
target- The targetSocketAddressusername- Usernameidentity- TheKeyPairidentity- Returns:
- Created
SftpClient- Note: closing the client also closes its underlying session - Throws:
IOException- If failed to login or authenticate
-
createSftpClient
protected SftpClient createSftpClient(org.apache.sshd.common.util.io.functors.IOFunction<? super org.apache.sshd.client.simple.SimpleClient, ? extends org.apache.sshd.client.session.ClientSession> sessionProvider) throws IOException- Throws:
IOException
-
createSftpClient
protected SftpClient createSftpClient(org.apache.sshd.client.session.ClientSession session) throws IOException - Throws:
IOException
-
isOpen
public boolean isOpen() -
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceChannel- Specified by:
closein interfaceCloseable- Throws:
IOException
-