Top Fields Constructors Methods
org.apache.sshd.sftp.client.impl

public Class SimpleSftpClientImpl

extends AbstractLoggingBean
implements SimpleSftpClient
Class Inheritance
All Implemented Interfaces
org.apache.sshd.sftp.client.SimpleSftpClient, java.nio.channels.Channel, java.io.Closeable, java.lang.AutoCloseable
Imports
java.io.IOException, java.net.SocketAddress, java.security.KeyPair, org.apache.sshd.client.session.ClientSession, org.apache.sshd.client.simple.SimpleClient, org.apache.sshd.common.util.ExceptionUtils, org.apache.sshd.common.util.io.functors.IOFunction, org.apache.sshd.common.util.logging.AbstractLoggingBean, org.apache.sshd.sftp.client.SftpClient, .SftpClientFactory, .SimpleSftpClient

Author
Apache MINA SSHD Project

Field Summary

Modifier and TypeField and Description
private SimpleClient
private SftpClientFactory
Inherited from org.apache.sshd.common.util.logging.AbstractLoggingBean:
log

Constructor Summary

AccessConstructor and Description
public
public
public

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements java.nio.channels.Channel.close.

Closes this channel.

protected SftpClient
createSftpClient(IOFunction<? super SimpleClient, ? extends ClientSession> sessionProvider)

protected SftpClient
public SimpleClient
public SftpClientFactory
public boolean
isOpen()

Implements java.nio.channels.Channel.isOpen.

Tells whether or not this channel is open.

public void
public void
public SftpClient
sftpLogin(SocketAddress
The target SocketAddress
target
,
String
Username
username
,
String
Password
password
)

Implements org.apache.sshd.sftp.client.SimpleSftpClient.sftpLogin.

Creates an SFTP session using the provided credentials

public SftpClient
sftpLogin(SocketAddress
The target SocketAddress
target
,
String
Username
username
,
KeyPair
The KeyPair identity
identity
)

Implements org.apache.sshd.sftp.client.SimpleSftpClient.sftpLogin.

Creates an SFTP session using the provided credentials

Inherited from org.apache.sshd.common.util.logging.AbstractLoggingBean:
debugdebugdebugdebugdebugerrorerrorerrorerrorerrorgetSimplifiedLoggerinfoinfowarnwarnwarnwarnwarnwarnwarnwarn

Field Detail

clientInstanceback to summary
private SimpleClient clientInstance
sftpClientFactoryback to summary
private SftpClientFactory sftpClientFactory

Constructor Detail

SimpleSftpClientImplback to summary
public SimpleSftpClientImpl()
SimpleSftpClientImplback to summary
public SimpleSftpClientImpl(SimpleClient client)
SimpleSftpClientImplback to summary
public SimpleSftpClientImpl(SimpleClient client, SftpClientFactory sftpClientFactory)

Method Detail

closeback to summary
public void close() throws IOException

Implements java.nio.channels.Channel.close.

Doc from java.nio.channels.Channel.close.

Closes this channel.

After a channel is closed, any further attempt to invoke I/O operations upon it will cause a ClosedChannelException to be thrown.

If this channel is already closed then invoking this method has no effect.

This method may be invoked at any time. If some other thread has already invoked it, however, then another invocation will block until the first invocation is complete, after which it will return without effect.

Annotations
@Override
Exceptions
IOException:
If an I/O error occurs
createSftpClientback to summary
protected SftpClient createSftpClient(IOFunction<? super SimpleClient, ? extends ClientSession> sessionProvider) throws IOException
createSftpClientback to summary
protected SftpClient createSftpClient(ClientSession session) throws IOException
getClientback to summary
public SimpleClient getClient()
getSftpClientFactoryback to summary
public SftpClientFactory getSftpClientFactory()
isOpenback to summary
public boolean isOpen()

Implements java.nio.channels.Channel.isOpen.

Doc from java.nio.channels.Channel.isOpen.

Tells whether or not this channel is open.

Returns:boolean

true if, and only if, this channel is open

Annotations
@Override
setClientback to summary
public void setClient(SimpleClient client)
setSftpClientFactoryback to summary
public void setSftpClientFactory(SftpClientFactory sftpClientFactory)
sftpLoginback to summary
public SftpClient sftpLogin(SocketAddress target, String username, String password) throws IOException

Implements org.apache.sshd.sftp.client.SimpleSftpClient.sftpLogin.

Doc from org.apache.sshd.sftp.client.SimpleSftpClient.sftpLogin.

Creates an SFTP session using the provided credentials

Parameters
target:SocketAddress

The target SocketAddress

username:String

Username

password:String

Password

Returns:SftpClient

Created SftpClient - Note: closing the client also closes its underlying session

Annotations
@Override
Exceptions
IOException:
If failed to login or authenticate
sftpLoginback to summary
public SftpClient sftpLogin(SocketAddress target, String username, KeyPair identity) throws IOException

Implements org.apache.sshd.sftp.client.SimpleSftpClient.sftpLogin.

Doc from org.apache.sshd.sftp.client.SimpleSftpClient.sftpLogin.

Creates an SFTP session using the provided credentials

Parameters
target:SocketAddress

The target SocketAddress

username:String

Username

identity:KeyPair

The KeyPair identity

Returns:SftpClient

Created SftpClient - Note: closing the client also closes its underlying session

Annotations
@Override
Exceptions
IOException:
If failed to login or authenticate