Java URI Create convertToURI(String value)

Here you can find the source of convertToURI(String value)

Description

convert To URI

License

Open Source License

Declaration

public static URI convertToURI(String value) 

Method Source Code

//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;
        }
    }
}

Related

  1. addQueryParametersToUri(URI uri, Map parameters)
  2. addQueryParamsToUri(String uri, Map queryParams)
  3. addQueryString(final URI uri, final String queryString)
  4. convertToURI(String uriOrPath)
  5. convertToURI(String uriString, Map aliasMap)
  6. create(final String uri)
  7. createAbsoluteURI(URI base, String uri)
  8. createConnection(final String uri, final String authValue)
  9. createDatastream(String registrationUri, String APIKey, String xmlDescription)