Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
git test
Hutool
Commits
28fefdeb
Commit
28fefdeb
authored
3 years ago
by
Looly
Browse files
Options
Download
Email Patches
Plain Diff
add SECURITY
parent
85bc21b6
v5-master
v5-dev
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
SECURITY.md
+15
-0
SECURITY.md
hutool-core/src/main/java/cn/hutool/core/compress/ZipWriter.java
+4
-4
...core/src/main/java/cn/hutool/core/compress/ZipWriter.java
hutool-core/src/test/java/cn/hutool/core/compress/ZipWriterTest.java
+11
-0
.../src/test/java/cn/hutool/core/compress/ZipWriterTest.java
with
30 additions
and
4 deletions
+30
-4
SECURITY.md
0 → 100644
+
15
-
0
View file @
28fefdeb
# 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
This diff is collapsed.
Click to expand it.
hutool-core/src/main/java/cn/hutool/core/compress/ZipWriter.java
+
4
-
4
View file @
28fefdeb
...
...
@@ -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
);
...
...
This diff is collapsed.
Click to expand it.
hutool-core/src/test/java/cn/hutool/core/compress/ZipWriterTest.java
+
11
-
0
View file @
28fefdeb
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
();
}
}
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help