public class ImapClient extends ClientConnection
CRLF
Constructor and Description |
---|
ImapClient(InetSocketAddress addr,
SecurityContext secContext) |
Modifier and Type | Method and Description |
---|---|
boolean |
authenticate(Credentials creds)
Authenticate with the strongest offered authentication scheme.
|
boolean |
authenticate(Credentials creds,
SaslMechanisms mech)
Authenticate with the specified SASL mechanism.
|
void |
imapStartTls()
Initiate a TLS handshake by issuing a STARTTLS command.
|
void |
processLine(String line) |
void |
run()
the processing methode of the running thread.
|
String[] |
sendCommand(String command)
Send a command to an IMAP server.
|
String[] |
sendCommand(String command,
long millisTimeout)
Send a command to an IMAP server.
|
shutdown
closeConnection, connect, do_handshake, do_teardown, enlargeApplicationBuffer, enlargeBuffer, enlargePacketBuffer, getDefaultTimeout, getEngine, getHostName, getPort, getProtocol, getSecurityContext, getSocketChannel, getTimeout, handleBufferUnderflow, handleEndOfStream, isShutdown, isTls, read, read, readln, readln, setDefaultTimeout, setEngine, setProtocol, setSecurityContext, setSocketChannel, setTimeout, startTls, startTls, write, write, writeln, writeln
public ImapClient(InetSocketAddress addr, SecurityContext secContext) throws IOException
IOException
public void imapStartTls() throws IOException
Initiate a TLS handshake by issuing a STARTTLS command.
IOException
- if handshake fails or a timeout is reachedpublic boolean authenticate(Credentials creds) throws TimeoutException
Authenticate with the strongest offered authentication scheme.
creds
- The credentials to be used for the authenticationTimeoutException
- if reaching a timeout while readingpublic boolean authenticate(Credentials creds, SaslMechanisms mech) throws TimeoutException
Authenticate with the specified SASL mechanism.
creds
- the credentials to be usedmech
- the SASL mechanism to be usedTimeoutException
- if reaching a timeout while readingpublic String[] sendCommand(String command) throws TimeoutException
Send a command to an IMAP server.
This is a blocking command honoring timeouts. The Timeout used is the default timeout.
command
- the command to be issuedTimeoutException
- if a timeout has bee reachedpublic String[] sendCommand(String command, long millisTimeout) throws TimeoutException
Send a command to an IMAP server.
This is a blocking command honoring timeouts. The Timeout used is the default timeout.
command
- the command to be issuedmillisTimeout
- The timeout in millisecondsTimeoutException
- if a timeout has bee reachedpublic void processLine(String line) throws IOException, TimeoutException
IOException
TimeoutException
public void run()
the processing methode of the running thread.
Do not call this method!
FIXME: move to a private runner.Copyright © 2023. All rights reserved.