Here you can find the source of convertToURI(String value)
public static URI convertToURI(String value)
//package com.java2s; /******************************************************************************* * Copyright (c) 2012 Firestar Software, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors://from w w w . jav a 2s. co m * Firestar Software, Inc. - initial API and implementation * * Author: * Gabriel Oancea * *******************************************************************************/ import java.net.*; public class Main { public static URI convertToURI(String value) { try { return value == null ? null : new URI(value); } catch (URISyntaxException exc) { return null; } } }