Here you can find the source of validateURI(String uri)
Parameter | Description |
---|---|
uri | the URI to verify |
Parameter | Description |
---|---|
URISyntaxException | the URI is invalid |
public static String validateURI(String uri) throws URISyntaxException
//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; } }