diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 000000000..d0c2c5589 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,15 @@ +# Security Policy + +## Supported Versions(支持的版本) + +| Version | Supported | +| ------- | ------------------ | +| 5.x.x | :white_check_mark: | +| 4.x.x | :x: | +| 3.x.x | :x: | + +## Reporting a Vulnerability(报告漏洞) + +如果你发现有安全问题或漏洞,请发送邮件到`loolly@aliyun.com`。 + +To report any found security issues or vulnerabilities, please send a mail to `loolly@aliyun.com`. \ No newline at end of file diff --git a/hutool-core/src/main/java/cn/hutool/core/compress/ZipWriter.java b/hutool-core/src/main/java/cn/hutool/core/compress/ZipWriter.java index 48962fe5f..b27d86338 100755 --- a/hutool-core/src/main/java/cn/hutool/core/compress/ZipWriter.java +++ b/hutool-core/src/main/java/cn/hutool/core/compress/ZipWriter.java @@ -26,22 +26,22 @@ import java.util.zip.ZipOutputStream; public class ZipWriter implements Closeable { /** - * 创建{@link ZipWriter} + * 创建ZipWriter * * @param zipFile 生成的Zip文件 * @param charset 编码 - * @return {@link ZipWriter} + * @return ZipWriter */ public static ZipWriter of(File zipFile, Charset charset) { return new ZipWriter(zipFile, charset); } /** - * 创建{@link ZipWriter} + * 创建ZipWriter * * @param out Zip输出的流,一般为输出文件流 * @param charset 编码 - * @return {@link ZipWriter} + * @return ZipWriter */ public static ZipWriter of(OutputStream out, Charset charset) { return new ZipWriter(out, charset); diff --git a/hutool-core/src/test/java/cn/hutool/core/compress/ZipWriterTest.java b/hutool-core/src/test/java/cn/hutool/core/compress/ZipWriterTest.java index 97bb6af52..c2a2f5bd4 100755 --- a/hutool-core/src/test/java/cn/hutool/core/compress/ZipWriterTest.java +++ b/hutool-core/src/test/java/cn/hutool/core/compress/ZipWriterTest.java @@ -1,5 +1,8 @@ package cn.hutool.core.compress; +import cn.hutool.core.io.FileUtil; +import cn.hutool.core.io.resource.FileResource; +import cn.hutool.core.util.CharsetUtil; import cn.hutool.core.util.ZipUtil; import org.junit.Ignore; import org.junit.Test; @@ -13,4 +16,12 @@ public class ZipWriterTest { public void zipDirTest() { ZipUtil.zip(new File("d:/test")); } + + @Test + @Ignore + public void addTest(){ + final ZipWriter writer = ZipWriter.of(FileUtil.file("d:/test/test.zip"), CharsetUtil.CHARSET_UTF_8); + writer.add(new FileResource("d:/test/qr_c.png")); + writer.close(); + } }