public class ImapPassthruServer extends Object
Constructor and Description |
---|
ImapPassthruServer(InetSocketAddress listeningAddress,
SecurityContext context,
Credentials listeningCredentials,
InetSocketAddress forwardingServer,
Credentials forwardingCredentials)
Create an IMAP passthru proxy server.
|
Modifier and Type | Method and Description |
---|---|
static String |
getPasswordFromUrl(String url)
Retrieves the password from an IMAPUrl string.
|
static int |
getPortFromUrl(String url)
retrieves the port number from an IMAPUrl string.
|
static String |
getProtocolFromUrl(String url)
retrieves the protocol string from an IMAPUrl string.
|
static InetSocketAddress |
getSocketAddressFromUrl(String url)
Convert an imap URL to a scket address with apropriate port.
|
static String |
getUsernameFromUrl(String url)
Retrieves the username from an IMAPUrl string.
|
void |
shutdown() |
public ImapPassthruServer(InetSocketAddress listeningAddress, SecurityContext context, Credentials listeningCredentials, InetSocketAddress forwardingServer, Credentials forwardingCredentials) throws IOException
Create an IMAP passthru proxy server.
listeningAddress
- listening address for the incomming proxy portcontext
- the security context for the proxy severlisteningCredentials
- credentials for the listening proxyforwardingServer
- IMAP address of the proxied serverforwardingCredentials
- credentials for the proxied IMAP serverIOException
- if start of proxy failspublic void shutdown() throws IOException
IOException
public static String getUsernameFromUrl(String url) throws ParseException
Retrieves the username from an IMAPUrl string.
url
- the URL to extract the portParseException
- if URL does not follow specificationNullPointerException
- if url is nullpublic static String getPasswordFromUrl(String url) throws ParseException
Retrieves the password from an IMAPUrl string.
url
- the URL to extract the portParseException
- if URL does not follow specificationNullPointerException
- if url is nullpublic static String getProtocolFromUrl(String url) throws ParseException
retrieves the protocol string from an IMAPUrl string.
url
- the URL to extract the portParseException
- if URL does not follow specificationNullPointerException
- if url is nullpublic static int getPortFromUrl(String url) throws ParseException
retrieves the port number from an IMAPUrl string.
url
- the URL to extract the portParseException
- if URL does not follow specificationNullPointerException
- if url is nullpublic static InetSocketAddress getSocketAddressFromUrl(String url) throws ParseException
Convert an imap URL to a scket address with apropriate port.
url
- the URL to be cconvertdeParseException
- if the pattern doeas not match a regular imap urlNullPointerException
- if the URL is nullCopyright © 2023. All rights reserved.