public final class ProviderUtility
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
extractProtocol(java.lang.String serverUrl,
java.lang.String fallback)
Extracts the protocol from specified server URL:
(<protocol>://)? |
static java.lang.String |
toSocketAddrString(java.lang.String serverUrl,
int defaultPort)
Turns given server URL to a String; e.g.
|
public static java.lang.String toSocketAddrString(java.lang.String serverUrl, int defaultPort) throws com.openexchange.exception.OXException
"mail.company.org:143"
.serverUrl
- The server URLdefaultPort
- The default port to use if server URL does not specify a port"mail.company.org:143"
com.openexchange.exception.OXException
- if the server URL can not be parsed.public static java.lang.String extractProtocol(java.lang.String serverUrl, java.lang.String fallback)
(<protocol>://)?(<host>)(:<port>)?
serverUrl
- The server URLfallback
- The fallback protocol if URL does not contain a protocolfallback
parameter