Java URL to File Name getFile(URL url)

Here you can find the source of getFile(URL url)

Description

get File

License

Open Source License

Declaration

public static File getFile(URL url) 

Method Source Code


//package com.java2s;
/*/* w  w w . j ava2s  .  c om*/
 * This file is part of the Jose Project
 * see http://jose-chess.sourceforge.net/
 * (c) 2002-2006 Peter Sch?fer
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 */

import java.io.*;
import java.net.URL;
import java.net.URLDecoder;

public class Main {
    public static File getFile(URL url) {
        return new File(getFilePath(url));
    }

    public static String getFilePath(URL url) {
        return URLDecoder.decode(url.getPath());
    }
}

Related

  1. getFile(URL resourceUrl, String description)
  2. getFile(URL resourceUrl, String description)
  3. getFile(URL ressource)
  4. getFile(URL url)
  5. getFile(URL url)
  6. getFile(URL url)
  7. getFile(URL url)
  8. getFile(URL url, String description)
  9. getFileAbsoluteURL(String[] directoryPaths, String fileName)