Merge from ECOMP's repository
[vid.git] / vid-app-common / src / main / java / org / onap / vid / utils / Unchecked.java
1 package org.onap.vid.utils;
2
3 import org.onap.vid.exceptions.GenericUncheckedException;
4
5 import java.net.URI;
6 import java.net.URISyntaxException;
7
8 public class Unchecked {
9     private Unchecked() {
10         // explicit private constructor, to hide the implicit public constructor
11     }
12
13     public static URI toURI(String uri) {
14         try {
15             // Indulge spaces in the URI by the replcement
16             return new URI(uri.replace(" ", "%20"));
17         } catch (URISyntaxException e) {
18             throw new GenericUncheckedException(e);
19         }
20     }
21
22
23 }