Class WSURI


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

      Constructors 
      Constructor Description
      WSURI()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.net.URI toHttp​(java.net.URI inputUri)
      Convert to HTTP http or https scheme URIs.
      static java.net.URI toWebsocket​(java.lang.CharSequence inputUrl)
      Convert to WebSocket ws or wss scheme URIs
      static java.net.URI toWebsocket​(java.lang.CharSequence inputUrl, java.lang.String query)
      Convert to WebSocket ws or wss scheme URIs
      static java.net.URI toWebsocket​(java.net.URI inputUri)
      Convert to WebSocket ws or wss scheme URIs
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • WSURI

        public WSURI()
    • Method Detail

      • toHttp

        public static java.net.URI toHttp​(java.net.URI inputUri)
                                   throws java.net.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:
        java.net.URISyntaxException - if unable to convert the input URI
      • toWebsocket

        public static java.net.URI toWebsocket​(java.lang.CharSequence inputUrl)
                                        throws java.net.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:
        java.net.URISyntaxException - if unable to convert the input URI
      • toWebsocket

        public static java.net.URI toWebsocket​(java.lang.CharSequence inputUrl,
                                               java.lang.String query)
                                        throws java.net.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:
        java.net.URISyntaxException - if unable to convert the input URI
      • toWebsocket

        public static java.net.URI toWebsocket​(java.net.URI inputUri)
                                        throws java.net.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:
        java.net.URISyntaxException - if unable to convert the input URI