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 TypeMethodDescriptionvoidclose()protected CloseableScpClientcreateScpClient(ClientSession session) protected CloseableScpClientcreateScpClient(IOFunction<? super SimpleClient, ? extends ClientSession> sessionProvider) booleanisOpen()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 credentialsvoidsetClient(SimpleClient client) voidsetScpClientCreator(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:SimpleScpClientCreates an SCP session using the provided credentials- Specified by:
scpLoginin interfaceSimpleScpClient- Parameters:
target- The targetSocketAddressusername- 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:SimpleScpClientCreates an SCP session using the provided credentials- Specified by:
scpLoginin interfaceSimpleScpClient- Parameters:
target- The targetSocketAddressusername- Usernameidentity- TheKeyPairidentity- 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:
closein interfaceAutoCloseable- Specified by:
closein interfaceChannel- Specified by:
closein interfaceCloseable- Throws:
IOException
-