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:
java.io.Closeable,java.lang.AutoCloseable,java.nio.channels.Channel,SimpleScpClient
public class SimpleScpClientImpl extends AbstractLoggingBean implements SimpleScpClient
TODO Add javadoc
-
-
Field Summary
Fields Modifier and Type Field Description private SimpleClientclientInstanceprivate ScpClientCreatorscpClientCreator-
Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
log
-
-
Constructor Summary
Constructors Constructor Description SimpleScpClientImpl()SimpleScpClientImpl(SimpleClient client)SimpleScpClientImpl(SimpleClient client, ScpClientCreator scpClientCreator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()protected CloseableScpClientcreateScpClient(ClientSession session)protected CloseableScpClientcreateScpClient(IOFunction<? super SimpleClient,? extends ClientSession> sessionProvider)SimpleClientgetClient()ScpClientCreatorgetScpClientCreator()booleanisOpen()CloseableScpClientscpLogin(java.net.SocketAddress target, java.lang.String username, java.lang.String password)Creates an SCP session using the provided credentialsCloseableScpClientscpLogin(java.net.SocketAddress target, java.lang.String username, java.security.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 Detail
-
clientInstance
private SimpleClient clientInstance
-
scpClientCreator
private ScpClientCreator scpClientCreator
-
-
Constructor Detail
-
SimpleScpClientImpl
public SimpleScpClientImpl()
-
SimpleScpClientImpl
public SimpleScpClientImpl(SimpleClient client)
-
SimpleScpClientImpl
public SimpleScpClientImpl(SimpleClient client, ScpClientCreator scpClientCreator)
-
-
Method Detail
-
getClient
public SimpleClient getClient()
-
setClient
public void setClient(SimpleClient client)
-
getScpClientCreator
public ScpClientCreator getScpClientCreator()
-
setScpClientCreator
public void setScpClientCreator(ScpClientCreator scpClientCreator)
-
scpLogin
public CloseableScpClient scpLogin(java.net.SocketAddress target, java.lang.String username, java.lang.String password) throws java.io.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:
java.io.IOException- If failed to login or authenticate
-
scpLogin
public CloseableScpClient scpLogin(java.net.SocketAddress target, java.lang.String username, java.security.KeyPair identity) throws java.io.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:
java.io.IOException- If failed to login or authenticate
-
createScpClient
protected CloseableScpClient createScpClient(IOFunction<? super SimpleClient,? extends ClientSession> sessionProvider) throws java.io.IOException
- Throws:
java.io.IOException
-
createScpClient
protected CloseableScpClient createScpClient(ClientSession session) throws java.io.IOException
- Throws:
java.io.IOException
-
isOpen
public boolean isOpen()
- Specified by:
isOpenin interfacejava.nio.channels.Channel
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.nio.channels.Channel- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
-