Java URI Encode encodeUri(URI uri)

Here you can find the source of encodeUri(URI uri)

Description

Encodes a URI into a flat character string.

License

Apache License

Parameter

Parameter Description
uri the target URI

Return

the encoded string

Declaration

public static String encodeUri(URI uri) 

Method Source Code

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

import java.net.URI;

public class Main {
    /**// w  w w  . j  a  v a2 s . c  o  m
     * Encodes a URI into a flat character string.
     * @param uri the target URI
     * @return the encoded string
     * @since 0.2.7
     */
    public static String encodeUri(URI uri) {
        if (uri == null) {
            return ""; //$NON-NLS-1$
        }
        return uri.toASCIIString();
    }
}

Related

  1. encodeURI(String s)
  2. encodeUri(String string)
  3. encodeURI(String uri)
  4. encodeUri(String uri)
  5. encodeUri(String uri)
  6. encodeURI(URI uri)
  7. encodeURIComponent(final String s)
  8. encodeURIComponent(String component)
  9. encodeURIComponent(String input)