download file from url
public static void main(String[] args) {
String url = "http://www.apache.org/dist/httpcomponents/httpclient/binary/httpcomponents-client-4.5-bin.zip";
String FileNamePath ="E:\\test\\test.jar";
getFile(url, FileNamePath);
}
public void getFile(String url, String FileNamePath) {
try{
URL source = new URL(url);
File destination = new File(FileNamePath);
FileUtils.copyURLToFile(source, destination);
System.out.println("File Downloaded!");
}catch(IOException e){
e.printStackTrace();
}
}