Java URL Normalize normalizeCapabilitiesUrl(String url)

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

Description

normalize Capabilities Url

License

GNU General Public License

Parameter

Parameter Description
url URL

Exception

Parameter Description
MalformedURLException in case of malformed URL

Return

normalized URL

Declaration

public static String normalizeCapabilitiesUrl(String url) throws MalformedURLException 

Method Source Code

//package com.java2s;
// License: GPL. For details, see LICENSE file.

import java.net.MalformedURLException;
import java.net.URL;

public class Main {
    /**//from   w  w w .j  a  v  a2 s  .co  m
     * @param url URL
     * @return normalized URL
     * @throws MalformedURLException in case of malformed URL
     * @since 10993
     */
    public static String normalizeCapabilitiesUrl(String url) throws MalformedURLException {
        URL inUrl = new URL(url);
        URL ret = new URL(inUrl.getProtocol(), inUrl.getHost(), inUrl.getPort(), inUrl.getFile());
        return ret.toExternalForm();
    }
}

Related

  1. normalize(String url_str)
  2. normalize(URL u)
  3. normalize(URL url)
  4. normalize(URL url)
  5. normalizeBaseUrl(String networkUrl)
  6. normalizePrefix(String url)
  7. normalizeShortUrl(String url)
  8. normalizeToLUrl(String toLUrl)
  9. normalizeToURL(String surl)