Java tutorial
//package com.java2s; import java.io.File; import java.io.IOException; import java.net.URL; public class Main { static String fileUrlToFilePath(String mediaPath) throws IOException { try { return new File(new URL(mediaPath).toURI()).getAbsolutePath(); } catch (IllegalArgumentException e) { throw new IOException("Unable to determine file path of file url " + mediaPath); } catch (Exception e) { throw new IOException("Unable to determine file path of file url " + mediaPath); } } }