public final class SftpSession extends Object implements Connectable, Closeable
Instances of this class are not safe for use by multiple threads.
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_PORT |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
boolean |
connect()
Try to connect this object.
|
boolean |
isConnected()
Answer whether this object is currently connected.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitconnect, ensureConnectedpublic static final int DEFAULT_PORT
public final boolean isConnected()
ConnectedTestableisConnected in interface ConnectedTestablepublic final boolean connect()
throws NotConnectedException
connect in interface ConnectableIllegalStateException - if this session is already closedNotConnectedException - if the internal JSch session cannot be openedNotConnectedException - if a wanted public-key authentication cannot be enabledpublic final void close()
close in interface Closeableclose in interface AutoCloseableCopyright © 2019. All rights reserved.