Java URI Create getURI(String spec)

Here you can find the source of getURI(String spec)

Description

get URI

License

Open Source License

Declaration

public static URI getURI(String spec) 

Method Source Code


//package com.java2s;
// Licensed under the Apache License, Version 2.0 (the "License");

import java.net.URI;
import java.net.URISyntaxException;

public class Main {
    public static URI getURI(String spec) {
        try {/*  ww w. ja  v  a 2 s  . c  o  m*/
            return new URI(spec);
        } catch (URISyntaxException e) {
            throw new IllegalArgumentException("Don't know how to convert " + spec + " to URI");
        }
    }
}

Related

  1. getURI(String path)
  2. getURI(String path)
  3. getURI(String path, String name)
  4. getURI(String protocol, String authority, String path, Hashtable params)
  5. getUri(String s, String h, int p, String path)
  6. getUri(String uriName)
  7. getURIAddress(URI uri)
  8. getUriByEndpoint(String endpoint)
  9. getURIFilename(final String s)