public class PopSsh extends Pop
Example Usage:
// connection parameters for SSH server
String sshHostname = "pop3.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
PopSsh pop = new PopSsh(sshParams, "pop3.myserver.com","jsmith","secret");
try
{
// connect to POP3 server
pop.connect();
// get messages
Enumeration e = pop.getMessages();
while(e.hasMoreElements()) {
EmailMessage em = (EmailMessage)e.nextElement();
}
// disconnect
pop.disconnect();
}
catch(Exception e)
{
System.out.println(e);
}
Pop.AuthenticationAUTH_APOP, AUTH_LOGIN, AUTH_PASS, AUTH_XOAUTH2| Constructor and Description |
|---|
PopSsh()
Constructs a new Pop instance.
|
PopSsh(SshParameters sshParameters,
java.lang.String hostname,
java.lang.String username,
java.lang.String password)
Constructs a new PopSsh instance.
|
PopSsh(java.lang.String hostname,
java.lang.String username,
java.lang.String password)
Constructs a new PopSsh instance.
|
| Modifier and Type | Method and Description |
|---|---|
PopSsh |
connect()
Connects to POP3 server tunelling data through SSH server and performs login with POP3 server.
|
void |
disconnect()
Disconnects from POP3 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.
|
addPopListener, clearProxySettings, close, deleteMessage, getAuthMode, getConnectTimeout, getDebugStream, getHostname, getMessage, getMessageCount, getMessageReader, getMessages, getMessageSize, getPort, getReadTimeout, getTimeout, getTop, getUid, getUsername, isConnected, isDebug, isDelete, issueCommand, issueCommand, issueCommandMultiLine, removePopListener, setAuthentication, setAuthMode, setConnectTimeout, setDebug, setDebugStream, setDelete, setHostname, setPassword, setPort, setProxyAuthentication, setProxyHost, setProxyType, setReadTimeout, setTimeout, setUsernamepublic PopSsh()
public PopSsh(java.lang.String hostname,
java.lang.String username,
java.lang.String password)
hostname - the hostname of POP3 serverusername - the username of POP3 userpassword - the password of POP3 userpublic PopSsh(SshParameters sshParameters, java.lang.String hostname, java.lang.String username, java.lang.String password)
hostname - the hostname of POP3 serverusername - the username of POP3 userpassword - the password of POP3 usersshParameters - the SSH parameters used in establishing a secure connectionpublic PopSsh connect() throws PopException
connect in class PopPopException - if I/O or POP3 related error occurspublic void disconnect()
throws PopException
disconnect in class PopPopException - if I/O or POP3 related error occurspublic SshParameters getSshParameters()
SshParameterspublic void setSshParameters(SshParameters parameters)
parameters - the SSH parametersSshParametersCopyright © JSCAPE LLC. 1999-2021. All Rights Reserved