Java URL Normalize normalizeUrl(String url)

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

Description

Normalises URL according to section 3 of Oauth 2 Draft 23.

License

Apache License

Parameter

Parameter Description
url a parameter

Declaration

public static String normalizeUrl(String url) 

Method Source Code

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

public class Main {
    /**//from  ww  w . ja  va 2 s  .com
     * Normalises URL according to section 3 of Oauth 2 Draft 23.
     * 
     * @param url
     * @return
     */
    public static String normalizeUrl(String url) {
        if (url != null && !url.isEmpty()) {
            int fragmentPos = url.indexOf("#");
            if (fragmentPos > -1) {
                return url.substring(0, fragmentPos);
            }
        }

        return url;
    }
}

Related

  1. NormalizeURL(final String taintedURL)
  2. normalizeUrl(final String url)
  3. normalizeUrl(String baseUrl, List urlList)
  4. normalizeUrl(String baseUrl, String url)
  5. normalizeURL(String solrServerUrl)
  6. normalizeUrl(String url)
  7. NormalizeURL(String URL)
  8. normalizeUrl(String url)
  9. normalizeUrl(String url)