|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnan.ssh.SSHConnection
A class to perform SSH services.
Method Summary | |
void |
close()
Close the SSH connection. |
void |
connect(ServerSettings settings)
Connects to the SSH server. |
void |
download(java.lang.String directory,
java.lang.String filename)
Downloads a file from the SSH server. |
static SSHConnection |
getInstance()
Returns the singleton instance of SSHConnection. |
boolean |
isConnected()
Asks if we are connected to the SSH server. |
boolean |
isConnectedTo(java.lang.String hostname,
int port)
Asks if we are connected to a particular server on a particular port. |
boolean |
openTunnel(ServerSettings settings)
Opens an SSH tunnel on this connection. |
java.lang.String |
toString()
Returns a String representation of this object. |
void |
upload(java.lang.String directory,
java.lang.String filename)
Uploads a file to the SSH server. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
public static SSHConnection getInstance()
public boolean isConnected()
public boolean isConnectedTo(java.lang.String hostname, int port)
hostname
- The hostname.port
- The port.
public void connect(ServerSettings settings) throws SSHConnectException
settings
- The Settings used to connect.
SSHConnectException
- if the connection fails to establish.public void close()
public boolean openTunnel(ServerSettings settings)
settings
- The Settings to use.
public void upload(java.lang.String directory, java.lang.String filename)
directory
- The server's directory.filename
- The filename to upload.public void download(java.lang.String directory, java.lang.String filename)
directory
- The server's directory.filename
- The filename to download.public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |