Java URI to Path getPath(String uriStr)

Here you can find the source of getPath(String uriStr)

Description

get Path

License

Open Source License

Declaration

public static String getPath(String uriStr) 

Method Source Code

//package com.java2s;

import java.net.*;

public class Main {

    public static String getPath(String uriStr) {
        URI uri = null;/*from  w  ww .ja va 2 s  .  c o m*/
        try {
            uri = new URI(uriStr);
        } catch (URISyntaxException e) {
            throw new RuntimeException(e.getLocalizedMessage());
        }

        return uri == null ? null : uri.getPath();
    }
}

Related

  1. getPath(final URI uri)
  2. getPath(final URI uri)
  3. getPath(URI addr)
  4. getPath(URI uri)
  5. getPathAndQueryURI(URI requestUri)
  6. getPathAsArray(URI uri)