|
Secure iNet Factory | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jscape.inet.imap.Imap
com.jscape.inet.imapssh.ImapSsh
public class ImapSsh
Implements the basic functionality of a IMAP client tunnelling data through a secure SSH connection.
Example Usage:
// connection information for SSH server String sshHostname = "imap4.myserver.com"; String sshUsername = "jsmith"; String sshPassword = "secret"; // create new SshParameters instance SshParameters sshParams = new SshParameters(sshHostname,sshUsername,sshPassword); // new instance with SSH parameters hostname, username and password ImapSsh imap = new ImapSsh(sshParams,"imap4.myserver.com","jsmith","secret"); try { // connect to IMAP4 server imap.connect(); // get messages int messageCount = imap.getMessageCount(); for(int i = 1; i <= messageCount(); ++i) { EmailMessage em = imap.getMessage(i); } // disconnect imap.disconnect(); } catch(Exception e) { System.out.println(e); }
Field Summary |
---|
Fields inherited from class com.jscape.inet.imap.Imap |
---|
AUTH_CRAM_MD5, AUTH_LOGIN, FLAG_ANSWERED, FLAG_DELETED, FLAG_DRAFT, FLAG_FLAGGED, FLAG_MODE_ADD, FLAG_MODE_DELETE, FLAG_MODE_REPLACE, FLAG_RECENT, FLAG_SEEN |
Constructor Summary | |
---|---|
ImapSsh()
Creates a new ImapSsh instance. |
|
ImapSsh(SshParameters sshParameters,
java.lang.String hostname,
java.lang.String username,
java.lang.String password)
Creates a new ImapSsh instance. |
|
ImapSsh(java.lang.String hostname,
java.lang.String username,
java.lang.String password)
Creates a new ImapSsh instance. |
Method Summary | |
---|---|
void |
connect()
Connects to IMAP server tunelling data through SSH server and performs login with IMAP server. |
void |
disconnect()
Disconnects from IMAP server. |
SshParameters |
getSshParameters()
Gets SSH parameters used in establishing connection with SSH server. |
void |
setSshParameters(SshParameters parameters)
Sets SSH parameters used in establishing connection with SSH server. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ImapSsh()
public ImapSsh(java.lang.String hostname, java.lang.String username, java.lang.String password)
hostname
- the IMAP hostnameusername
- the IMAP usernamepassword
- the IMAP passwordpublic ImapSsh(SshParameters sshParameters, java.lang.String hostname, java.lang.String username, java.lang.String password)
hostname
- the IMAP hostnameusername
- the IMAP usernamepassword
- the IMAP passwordsshParameters
- the SSH parameters used in establishing a secure connectionMethod Detail |
---|
public void connect() throws ImapException
connect
in class Imap
ImapException
- if I/O or IMAP related error occurspublic void disconnect() throws ImapException
disconnect
in class Imap
ImapException
- if I/O or IMAP related error occursImap.connect()
public SshParameters getSshParameters()
SshParameters
public void setSshParameters(SshParameters parameters)
parameters
- the SSH parametersSshParameters
|
Secure iNet Factory | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |