// 获取下载位置 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);
}