Package org.apache.sshd.scp.client
Class SimpleScpClientImpl
java.lang.Object
org.apache.sshd.common.util.logging.AbstractLoggingBean
org.apache.sshd.scp.client.SimpleScpClientImpl
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Channel
,SimpleScpClient
TODO Add javadoc
-
Field Summary
FieldsFields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
log
-
Constructor Summary
ConstructorsConstructorDescriptionSimpleScpClientImpl
(SimpleClient client) SimpleScpClientImpl
(SimpleClient client, ScpClientCreator scpClientCreator) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
protected CloseableScpClient
createScpClient
(ClientSession session) protected CloseableScpClient
createScpClient
(IOFunction<? super SimpleClient, ? extends ClientSession> sessionProvider) boolean
isOpen()
scpLogin
(SocketAddress target, String username, String password) Creates an SCP session using the provided credentialsscpLogin
(SocketAddress target, String username, KeyPair identity) Creates an SCP session using the provided credentialsvoid
setClient
(SimpleClient client) void
setScpClientCreator
(ScpClientCreator scpClientCreator) Methods 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
-
Field Details
-
clientInstance
-
scpClientCreator
-
-
Constructor Details
-
SimpleScpClientImpl
public SimpleScpClientImpl() -
SimpleScpClientImpl
-
SimpleScpClientImpl
-
-
Method Details
-
getClient
-
setClient
-
getScpClientCreator
-
setScpClientCreator
-
scpLogin
public CloseableScpClient scpLogin(SocketAddress target, String username, String password) throws IOException Description copied from interface:SimpleScpClient
Creates an SCP session using the provided credentials- Specified by:
scpLogin
in interfaceSimpleScpClient
- Parameters:
target
- The targetSocketAddress
username
- Usernamepassword
- Password- Returns:
- Created
CloseableScpClient
- Note: closing the client also closes its underlying session - Throws:
IOException
- If failed to login or authenticate
-
scpLogin
public CloseableScpClient scpLogin(SocketAddress target, String username, KeyPair identity) throws IOException Description copied from interface:SimpleScpClient
Creates an SCP session using the provided credentials- Specified by:
scpLogin
in interfaceSimpleScpClient
- Parameters:
target
- The targetSocketAddress
username
- Usernameidentity
- TheKeyPair
identity- Returns:
- Created
CloseableScpClient
- Note: closing the client also closes its underlying session - Throws:
IOException
- If failed to login or authenticate
-
createScpClient
protected CloseableScpClient createScpClient(IOFunction<? super SimpleClient, ? extends ClientSession> sessionProvider) throws IOException- Throws:
IOException
-
createScpClient
- Throws:
IOException
-
isOpen
public boolean isOpen() -
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceChannel
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-