Skip to content

Commit

Permalink
add SECURITY
Browse files Browse the repository at this point in the history
  • Loading branch information
looly committed Oct 12, 2021
1 parent 85bc21b commit 28fefde
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 4 deletions.
15 changes: 15 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -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(报告漏洞)

如果你发现有安全问题或漏洞,请发送邮件到`[email protected]`

To report any found security issues or vulnerabilities, please send a mail to `[email protected]`.
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,22 @@
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);
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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();
}
}

0 comments on commit 28fefde

Please sign in to comment.