Here you can find the source of download(String url, String inputFile, String outputPath, String outputFile)
public static Path download(String url, String inputFile, String outputPath, String outputFile) throws Exception
//package com.java2s; //License from project: Open Source License import java.io.InputStream; import java.net.URI; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.StandardCopyOption; public class Main { public static Path download(String url, String inputFile, String outputPath, String outputFile) throws Exception { return download(url + inputFile, outputPath, outputFile); }/* w w w . j a v a2s.c o m*/ public static Path download(String url, String outputPath, String outputFile) throws Exception { Path output = Paths.get(outputPath); if (Files.notExists(output)) { Files.createDirectory(output); } URI u = URI.create(url); Path file = output.resolve(outputFile); try (InputStream in = u.toURL().openStream()) { Files.copy(in, file, StandardCopyOption.REPLACE_EXISTING); } return file; } }