mirror of
https://gitee.com/dromara/hutool.git
synced 2025-04-05 17:37:59 +08:00
add SECURITY
This commit is contained in:
parent
85bc21b6c1
commit
28fefdeb1b
15
SECURITY.md
Normal file
15
SECURITY.md
Normal file
@ -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`.
|
@ -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);
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user