Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
Y
yzg-util
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
YZG
yzg-util
Commits
f52aa9b7
Commit
f52aa9b7
authored
May 08, 2019
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Excel导出功能
parent
06e5e0a6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
12 deletions
+18
-12
FileHelper.java
...src/main/java/com/yanzuoguang/util/helper/FileHelper.java
+15
-12
ZipHelper.java
.../src/main/java/com/yanzuoguang/util/helper/ZipHelper.java
+3
-0
No files found.
yzg-util-base/src/main/java/com/yanzuoguang/util/helper/FileHelper.java
View file @
f52aa9b7
...
...
@@ -11,6 +11,7 @@ import java.io.RandomAccessFile;
/**
* 登录相关函数
*
* @author 颜佐光
*/
public
class
FileHelper
{
...
...
@@ -169,6 +170,7 @@ public class FileHelper {
boolean
flag
=
true
;
//删除文件夹下的所有文件(包括子目录)
File
[]
files
=
dirFile
.
listFiles
();
if
(
files
!=
null
)
{
for
(
int
i
=
0
;
i
<
files
.
length
;
i
++)
{
//删除子文件
if
(
files
[
i
].
isFile
())
{
...
...
@@ -184,6 +186,7 @@ public class FileHelper {
}
}
}
}
if
(!
flag
)
{
return
false
;
}
...
...
yzg-util-base/src/main/java/com/yanzuoguang/util/helper/ZipHelper.java
View file @
f52aa9b7
...
...
@@ -246,6 +246,9 @@ public class ZipHelper {
*/
private
static
void
dealDirFile
(
File
dirFile
,
String
parentDir
,
BufferedOutputStream
bufferOutStream
,
ZipOutputStream
zipOutStream
)
throws
IOException
{
File
[]
fileList
=
dirFile
.
listFiles
();
if
(
fileList
==
null
)
{
return
;
}
for
(
File
file
:
fileList
)
{
if
(
file
.
isFile
())
{
// 创建压缩文件实体
...
...
Write
Preview
Markdown
is supported
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