![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
java日常
weixin_40388298
一心想把java搞明白的猿
展开
-
下载文件服务器上文件,并且zip打包响应给客户端下载
不废话,看代码public static List<String> downloadToLocal(List<String> urls, HttpServletResponse response) { response.setContentType("application/x-msdownload;charset=utf-8"); String rootPath = FILE_ADDRESS; File file = new File(rootPath);原创 2021-09-13 10:41:10 · 297 阅读 · 1 评论 -
java FtpClient文件下载方法
public void downloadFileStream(HttpServletResponse response, String path, String fileName) { OutputStream outputStream = null; FTPClient ftpClient = getFtpClient(); InputStream in = null; BufferedInputStream bis = null; try { int ind.原创 2021-08-25 11:19:07 · 2259 阅读 · 0 评论 -
java 获取桌面地址
//获取桌面地址FileSystemView fsv = FileSystemView.getFileSystemView();File com=fsv.getHomeDirectory();System.out.println(com.getPath());String path="ftp://10.1.48.35/KM_14_36/2020-12-29/KM_20_13978.dwg";String substr=path.substring(0,path.lastIndexOf("/".原创 2021-08-25 11:13:18 · 348 阅读 · 0 评论