Here you can find the source of toURI(String uri)
Parameter | Description |
---|---|
uri | The URI string to convert. |
static final URI toURI(String uri)
//package com.java2s; // * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file * import java.net.*; public class Main { /**//from w w w . j av a 2s . c o m * Converts a string to a URI without a {@link URISyntaxException} * * @param uri The URI string to convert. * @return A new URI object. */ static final URI toURI(String uri) { try { return new URI(uri); } catch (URISyntaxException e) { throw new RuntimeException(e); } } }