Package org.drasyl.util
Class WebSocketUtil
java.lang.Object
org.drasyl.util.WebSocketUtil
Utility class for operations on websocket
URI
s (e.g. ws://foo.bar).-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
static boolean
isWebSocketSecureURI
(URI uri) static boolean
isWebSocketURI
(URI uri) static int
webSocketPort
(URI uri)
-
Field Details
-
WS_PORT
public static final int WS_PORT- See Also:
-
WSS_PORT
public static final int WSS_PORT- See Also:
-
-
Method Details
-
webSocketPort
- Parameters:
uri
- the URI to be used for determining the WebSocket URI- Returns:
- the port in the WebSocket URI. If no custom port is specified, the protocol default port is assumed
- Throws:
IllegalArgumentException
- if no port could be determinedNullPointerException
- ifuri
isnull
-
isWebSocketSecureURI
- Parameters:
uri
- the URI to be checked- Returns:
true
ifuri
is a WebSocket Secure URI. Otherwise, returnsfalse
- Throws:
NullPointerException
- ifuri
isnull
-
isWebSocketNonSecureURI
- Parameters:
uri
- the URI to be checked- Returns:
true
ifuri
is a non-secure Websocket URI. Otherwise, returnsfalse
- Throws:
NullPointerException
- ifuri
isnull
-
isWebSocketURI
- Parameters:
uri
- the URI to be checked- Returns:
true
ifuri
is Websocket URI. Otherwise, returnsfalse
- Throws:
NullPointerException
- ifuri
isnull
-