Package org.apache.commons.net.imap
Class AuthenticatingIMAPClient
java.lang.Object
org.apache.commons.net.SocketClient
org.apache.commons.net.imap.IMAP
org.apache.commons.net.imap.IMAPClient
org.apache.commons.net.imap.IMAPSClient
org.apache.commons.net.imap.AuthenticatingIMAPClient
An IMAP Client class with authentication support.
- See Also:
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic enumThe enumeration of currently-supported authentication methods.Nested classes/interfaces inherited from class org.apache.commons.net.imap.IMAPClientIMAPClient.FETCH_ITEM_NAMES, IMAPClient.SEARCH_CRITERIA, IMAPClient.STATUS_DATA_ITEMSNested classes/interfaces inherited from class org.apache.commons.net.imap.IMAPIMAP.IMAPChunkListener, IMAP.IMAPState
- 
Field SummaryFields inherited from class org.apache.commons.net.imap.IMAPSClientDEFAULT_IMAPS_PORT, DEFAULT_PROTOCOLFields inherited from class org.apache.commons.net.imap.IMAP__DEFAULT_ENCODING, __writer, _reader, DEFAULT_PORT, TRUE_CHUNK_LISTENERFields inherited from class org.apache.commons.net.SocketClient_defaultPort_, _hostname_, _input_, _output_, _serverSocketFactory_, _socket_, _socketFactory_, _timeout_, connectTimeout, NETASCII_EOL, remoteInetSocketAddress
- 
Constructor SummaryConstructorsConstructorDescriptionConstructor for AuthenticatingIMAPClient that delegates to IMAPSClient.AuthenticatingIMAPClient(boolean implicit) Constructor for AuthenticatingIMAPClient that delegates to IMAPSClient.AuthenticatingIMAPClient(boolean implicit, SSLContext ctx) Constructor for AuthenticatingIMAPClient that delegates to IMAPSClient.AuthenticatingIMAPClient(String proto) Constructor for AuthenticatingIMAPClient that delegates to IMAPSClient.AuthenticatingIMAPClient(String proto, boolean implicit) Constructor for AuthenticatingIMAPClient that delegates to IMAPSClient.AuthenticatingIMAPClient(String proto, boolean implicit, SSLContext ctx) Constructor for AuthenticatingIMAPClient that delegates to IMAPSClient.AuthenticatingIMAPClient(SSLContext context) Constructor for AuthenticatingIMAPClient that delegates to IMAPSClient.
- 
Method SummaryModifier and TypeMethodDescriptionbooleanauth(AuthenticatingIMAPClient.AUTH_METHOD method, String user, String password) Authenticate to the IMAP server by sending the AUTHENTICATE command with the selected mechanism, using the given user and the given password.booleanauthenticate(AuthenticatingIMAPClient.AUTH_METHOD method, String user, String password) Authenticate to the IMAP server by sending the AUTHENTICATE command with the selected mechanism, using the given user and the given password.Methods inherited from class org.apache.commons.net.imap.IMAPSClient_connectAction_, execTLS, getEnabledCipherSuites, getEnabledProtocols, getHostnameVerifier, getTrustManager, isEndpointCheckingEnabled, setEnabledCipherSuites, setEnabledProtocols, setEndpointCheckingEnabled, setHostnameVerifier, setKeyManager, setTrustManagerMethods inherited from class org.apache.commons.net.imap.IMAPClientappend, append, append, capability, check, close, copy, create, delete, examine, expunge, fetch, list, login, logout, lsub, noop, rename, search, search, select, status, store, subscribe, uid, unsubscribeMethods inherited from class org.apache.commons.net.imap.IMAPdisconnect, doCommand, doCommand, fireReplyReceived, generateCommandID, getReplyString, getReplyStrings, getState, sendCommand, sendCommand, sendCommand, sendCommand, sendData, setChunkListener, setStateMethods inherited from class org.apache.commons.net.SocketClientaddProtocolCommandListener, applySocketAttributes, checkOpenOutputStream, connect, connect, connect, connect, connect, connect, createCommandSupport, fireCommandSent, getCharset, getCharsetName, getCommandSupport, getConnectTimeout, getDefaultPort, getDefaultTimeout, getKeepAlive, getLocalAddress, getLocalPort, getProxy, getReceiveBufferSize, getRemoteAddress, getRemoteInetSocketAddress, getRemotePort, getSendBufferSize, getServerSocketFactory, getSoLinger, getSoTimeout, getTcpNoDelay, isAvailable, isConnected, removeProtocolCommandListener, setCharset, setConnectTimeout, setDefaultPort, setDefaultTimeout, setKeepAlive, setProxy, setReceiveBufferSize, setSendBufferSize, setServerSocketFactory, setSocketFactory, setSoLinger, setSoTimeout, setTcpNoDelay, verifyRemote
- 
Constructor Details- 
AuthenticatingIMAPClientpublic AuthenticatingIMAPClient()Constructor for AuthenticatingIMAPClient that delegates to IMAPSClient. Sets security mode to explicit (isImplicit = false).
- 
AuthenticatingIMAPClientConstructor for AuthenticatingIMAPClient that delegates to IMAPSClient.- Parameters:
- implicit- The security mode (Implicit/Explicit).
 
- 
AuthenticatingIMAPClientConstructor for AuthenticatingIMAPClient that delegates to IMAPSClient.- Parameters:
- implicit- The security mode(Implicit/Explicit).
- ctx- A pre-configured SSL Context.
 
- 
AuthenticatingIMAPClientConstructor for AuthenticatingIMAPClient that delegates to IMAPSClient.- Parameters:
- context- A pre-configured SSL Context.
 
- 
AuthenticatingIMAPClientConstructor for AuthenticatingIMAPClient that delegates to IMAPSClient.- Parameters:
- proto- the protocol.
 
- 
AuthenticatingIMAPClientConstructor for AuthenticatingIMAPClient that delegates to IMAPSClient.- Parameters:
- proto- the protocol.
- implicit- The security mode(Implicit/Explicit).
 
- 
AuthenticatingIMAPClientConstructor for AuthenticatingIMAPClient that delegates to IMAPSClient.- Parameters:
- proto- the protocol.
- implicit- The security mode(Implicit/Explicit).
- ctx- the context
 
 
- 
- 
Method Details- 
authpublic boolean auth(AuthenticatingIMAPClient.AUTH_METHOD method, String user, String password) throws IOException, NoSuchAlgorithmException, InvalidKeyException, InvalidKeySpecException Authenticate to the IMAP server by sending the AUTHENTICATE command with the selected mechanism, using the given user and the given password.- Parameters:
- method- the method name
- user- user
- password- password
- Returns:
- True if successfully completed, false if not.
- Throws:
- IOException- If an I/O error occurs while either sending a command to the server or receiving a reply from the server.
- NoSuchAlgorithmException- If the CRAM hash algorithm cannot be instantiated by the Java runtime system.
- InvalidKeyException- If the CRAM hash algorithm failed to use the given password.
- InvalidKeySpecException- If the CRAM hash algorithm failed to use the given password.
 
- 
authenticatepublic boolean authenticate(AuthenticatingIMAPClient.AUTH_METHOD method, String user, String password) throws IOException, NoSuchAlgorithmException, InvalidKeyException, InvalidKeySpecException Authenticate to the IMAP server by sending the AUTHENTICATE command with the selected mechanism, using the given user and the given password.- Parameters:
- method- the method name
- user- user
- password- password
- Returns:
- True if successfully completed, false if not.
- Throws:
- IOException- If an I/O error occurs while either sending a command to the server or receiving a reply from the server.
- NoSuchAlgorithmException- If the CRAM hash algorithm cannot be instantiated by the Java runtime system.
- InvalidKeyException- If the CRAM hash algorithm failed to use the given password.
- InvalidKeySpecException- If the CRAM hash algorithm failed to use the given password.
 
 
-