// 獲取下載位置 url
private String isExistDir(String saveDir) throws IOException {spa
File downloadFile = new File("/Users/dongbo/Downloads");接口
if (!downloadFile.mkdirs()) {get
downloadFile.createNewFile();string
}it
String savePath = downloadFile.getAbsolutePath();io
return savePath;ast
}class
//獲取接口地址結尾名稱下載
private String getNameFromUrl(String url) {
return url.substring(url.lastIndexOf("/") + 1);
}