Java URI Value Check validateURI(String uri)

Here you can find the source of validateURI(String uri)

Description

Verifies the validity of a complete URI

License

Open Source License

Parameter

Parameter Description
uri the URI to verify

Exception

Parameter Description
URISyntaxException the URI is invalid

Return

the URI to verify

Declaration


public static String validateURI(String uri) throws URISyntaxException 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.net.URI;
import java.net.URISyntaxException;

public class Main {
    /**/*ww  w .j  a va2  s  .  c o m*/
     * 
     * Verifies the validity of a complete URI
     * 
     * @param uri
     *            the URI to verify
     * @return the URI to verify
     * @throws URISyntaxException the URI is invalid
     *
     */

    public static String validateURI(String uri) throws URISyntaxException {
        try {
            new URI(uri);
        } catch (URISyntaxException e) {
            throw e;
        }
        return uri;
    }
}

Related

  1. isVirtual(URI locationURI)
  2. isVSO(final URI uri)
  3. isWellFormedUriString(final String uriString)
  4. validateURI(final String uri)
  5. validateUri(String uri)
  6. validateUri(String uri)
  7. validateUri(String uri, String name)