public final class SftpChannel extends Object implements Connectable, Closeable
Instances of this class are not safe for use by multiple threads.
| Constructor and Description |
|---|
SftpChannel(SftpSession session,
boolean autoCloseSession)
Create a new SFTP channel.
|
| 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 SftpChannel(SftpSession session, boolean autoCloseSession)
This channel can be connected by a call to its own connect() method.
session - The SFTP sessionautoCloseSession - Flag whether to close the SFTP session automatically when this channel will be closedIllegalArgumentException - if the SFTP session is nullpublic final boolean isConnected()
ConnectedTestableisConnected in interface ConnectedTestablepublic final boolean connect()
throws NotConnectedException
connect in interface ConnectableIllegalStateException - if this channel is already closedNotConnectedException - in case of errorpublic final void close()
close in interface Closeableclose in interface AutoCloseableCopyright © 2019. All rights reserved.