Java URI from toURI(String location)

Here you can find the source of toURI(String location)

Description

to URI

License

Apache License

Declaration

public static URI toURI(String location) throws URISyntaxException 

Method Source Code

//package com.java2s;
//License from project: Apache License 

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

public class Main {
    public static URI toURI(URL url) throws URISyntaxException {
        return toURI(url.toString());
    }//from  w w  w.  java 2  s.c  o m

    public static URI toURI(String location) throws URISyntaxException {
        return new URI(location.replace(" ", "%20"));
    }
}

Related

  1. toURI(final String uriString)
  2. toUri(java.io.File file)
  3. toUri(String endpoint, Protocol protocol)
  4. toUri(String ip, String path)
  5. toURI(String location)
  6. toURI(String location)
  7. toURI(String location)
  8. toURI(String location)
  9. toUri(String path)