Java URL Resolve resolveWsURI(String url)

Here you can find the source of resolveWsURI(String url)

Description

resolve Ws URI

License

Apache License

Declaration

static URI resolveWsURI(String url) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.net.URI;

public class Main {
    static URI resolveWsURI(String url) {
        return url.startsWith("http") ? URI.create(url.replaceFirst("http", "ws"))
                : url.startsWith("https") ? URI.create(url.replaceFirst("https", "wss")) : URI.create(url);
    }/*from w  w w  . ja v  a 2s  .co  m*/
}

Related

  1. resolveUrl(String url, Properties properties)
  2. resolveURL(String urlValue)
  3. resolveURL(URL base, String target)
  4. resolveURL(URL contextURL, String url)
  5. resolveURL(URL url)
  6. resolveXmlConfigUrl(@Nullable URL defaultXmlConfigUrl)
  7. reverseUrl(String urlString)