设置下载文件路径 & 获取接口结尾名称。

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

        }

相关文章
相关标签/搜索