Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.net.MalformedURLException;
import java.net.URL;

public class Main {
    public static String getPathFromUrl(String url) {
        URL iurl;
        try {
            iurl = new URL(url);
            return iurl.getPath();

        } catch (MalformedURLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
            return "";
        }
    }
}