Top Description Constructors Methods
org.eclipse.jetty.websocket.api.util

public final Class WSURI

extends Object
Class Inheritance
Imports
java.net.URI, .URISyntaxException, java.util.Objects

Utility methods for converting a URI between a HTTP(S) and WS(S) URI.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static URI

Returns:

the HTTP scheme URI for the input URI.
toHttp
(final URI
the input URI
inputUri
)

Convert to HTTP http or https scheme URIs.

public static URI

Returns:

the WebSocket scheme URI for the input URI.
toWebsocket
(CharSequence
the input URI
inputUrl
)

Convert to WebSocket ws or wss scheme URIs

Converting http and https URIs to their WebSocket equivalent

public static URI

Returns:

the WebSocket scheme URI for the input URI.
toWebsocket
(CharSequence
the input URI
inputUrl
,
String
the optional query string
query
)

Convert to WebSocket ws or wss scheme URIs

Converting http and https URIs to their WebSocket equivalent

public static URI

Returns:

the WebSocket scheme URI for the input URI.
toWebsocket
(final URI
the input URI
inputUri
)

Convert to WebSocket ws or wss scheme URIs

Converting http and https URIs to their WebSocket equivalent

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

WSURIback to summary
public WSURI()

Method Detail

toHttpback to summary
public static URI toHttp(final URI inputUri) throws URISyntaxException

Convert to HTTP http or https scheme URIs.

Converting ws and wss URIs to their HTTP equivalent

Parameters
inputUri:URI

the input URI

Returns:URI

the HTTP scheme URI for the input URI.

Exceptions
URISyntaxException:
if unable to convert the input URI
toWebsocketback to summary
public static URI toWebsocket(CharSequence inputUrl) throws URISyntaxException

Convert to WebSocket ws or wss scheme URIs

Converting http and https URIs to their WebSocket equivalent

Parameters
inputUrl:CharSequence

the input URI

Returns:URI

the WebSocket scheme URI for the input URI.

Exceptions
URISyntaxException:
if unable to convert the input URI
toWebsocketback to summary
public static URI toWebsocket(CharSequence inputUrl, String query) throws URISyntaxException

Convert to WebSocket ws or wss scheme URIs

Converting http and https URIs to their WebSocket equivalent

Parameters
inputUrl:CharSequence

the input URI

query:String

the optional query string

Returns:URI

the WebSocket scheme URI for the input URI.

Exceptions
URISyntaxException:
if unable to convert the input URI
toWebsocketback to summary
public static URI toWebsocket(final URI inputUri) throws URISyntaxException

Convert to WebSocket ws or wss scheme URIs

Converting http and https URIs to their WebSocket equivalent

Parameters
inputUri:URI

the input URI

Returns:URI

the WebSocket scheme URI for the input URI.

Exceptions
URISyntaxException:
if unable to convert the input URI