Java URL to Path getPathFromURL(final String url)

Here you can find the source of getPathFromURL(final String url)

Description

get Path From URL

License

Open Source License

Declaration

public static String getPathFromURL(final String url) throws MalformedURLException 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.net.MalformedURLException;

import java.net.URL;

public class Main {
    public static String getPathFromURL(final String url) throws MalformedURLException {
        URL urlObj = new URL(url);
        return urlObj.getPath();
    }/*from w  ww . j a v a 2  s  . com*/
}

Related

  1. getPath(String url)
  2. getPath(String urlString)
  3. getPath(URL theURL)
  4. getPath(URL url)
  5. getPath(URL url)
  6. getPathParts(String url)