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
public class SimpleScpClientImpl extends AbstractLoggingBean implements SimpleScpClient
TODO Add javadoc- Author:
- Apache MINA SSHD Project
-
-
Field Summary
-
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 void
close()
protected CloseableScpClient
createScpClient(ClientSession session)
protected CloseableScpClient
createScpClient(IOFunction<? super SimpleClient,? extends ClientSession> sessionProvider)
SimpleClient
getClient()
ScpClientCreator
getScpClientCreator()
boolean
isOpen()
CloseableScpClient
scpLogin(SocketAddress target, String username, String password)
Creates an SCP session using the provided credentialsCloseableScpClient
scpLogin(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
-
-
-
-
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(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
protected CloseableScpClient createScpClient(ClientSession session) throws IOException
- Throws:
IOException
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceChannel
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
-