![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
java工具类
Kevin丶啊
新人菜鸟一枚,记录下日常编码,也可以来meetns.cn看看额(⊙o⊙)…
展开
-
使用apache.tools.zip进行文件压缩解压
需要引入apache-ant-zip.jar包,简单封装的一个工具类可以直接用,还有升级空间import java.io.*;import java.util.Enumeration;import java.util.zip.*;import org.apache.log4j.Logger;import org.apache.tools.zip.ZipEntry;import ...原创 2019-01-22 14:51:07 · 1385 阅读 · 1 评论 -
在SpringMvc中文件下载的简单方式
1.通过使用普通的方式进行文件下载@ResponseBody@RequestMapping(value = "/downLoadImage")public void downImageTemplate(HttpServletRequest request, HttpServletResponse response) throws IOException { Buffere...翻译 2019-01-22 15:00:47 · 127 阅读 · 0 评论 -
使用java将文件上传到ftp服务器
一、创建ftp服务配置对象public class FtpSettings { private String host; private String uname; private String password; private String root; private String httpUrl; public String ...原创 2019-01-22 15:10:53 · 652 阅读 · 0 评论 -
java实现将本地文件上传至阿里oss云
static Map<String, String> contentTypeMap;//以下几个参数值必填,参考文章最后文档static String endpoint = "";static String accessKeyId = "";static String accessKeySecert = "";static String bucketName = "";...原创 2019-01-22 15:15:22 · 3047 阅读 · 0 评论 -
java递归实现删除文件目录及其子目录和文件
/** * 递归删除目录 * @param sourceFile * @return */public static boolean deleteAllFile(File sourceFile){ if (!sourceFile.exists()){ return false; } File[] files=sourceFile.listFile...原创 2019-01-23 13:31:35 · 250 阅读 · 0 评论