Here you can find the source of getFile(URL url)
Parameter | Description |
---|---|
url | to convert |
public static File getFile(URL url)
//package com.java2s; import java.io.File; import java.net.URISyntaxException; import java.net.URL; public class Main { /**/*from w w w . j a v a 2 s . c om*/ * For local file conversion. FIXME is this correct on Windows? * * @param url * to convert * @return file from url */ public static File getFile(URL url) { File f = null; try { f = new File(url.toURI()); } catch (URISyntaxException e) { f = new File(url.getPath()); } return f; } }