java.lang.Object
org.eclipse.jetty.websocket.api.util.WSURI

public final class WSURI extends Object
Utility methods for converting a URI between a HTTP(S) and WS(S) URI.
  • Constructor Details

    • WSURI

      public WSURI()
  • Method Details

    • toHttp

      public static URI toHttp(URI inputUri) throws URISyntaxException
      Convert to HTTP http or https scheme URIs.

      Converting ws and wss URIs to their HTTP equivalent

      Parameters:
      inputUri - the input URI
      Returns:
      the HTTP scheme URI for the input URI.
      Throws:
      URISyntaxException - if unable to convert the input URI
    • toWebsocket

      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 - the input URI
      Returns:
      the WebSocket scheme URI for the input URI.
      Throws:
      URISyntaxException - if unable to convert the input URI
    • toWebsocket

      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 - the input URI
      query - the optional query string
      Returns:
      the WebSocket scheme URI for the input URI.
      Throws:
      URISyntaxException - if unable to convert the input URI
    • toWebsocket

      public static URI toWebsocket(URI inputUri) throws URISyntaxException
      Convert to WebSocket ws or wss scheme URIs

      Converting http and https URIs to their WebSocket equivalent

      Parameters:
      inputUri - the input URI
      Returns:
      the WebSocket scheme URI for the input URI.
      Throws:
      URISyntaxException - if unable to convert the input URI