Commit f52aa9b7 authored by yanzg's avatar yanzg

Excel导出功能

parent 06e5e0a6
......@@ -11,6 +11,7 @@ import java.io.RandomAccessFile;
/**
* 登录相关函数
*
* @author 颜佐光
*/
public class FileHelper {
......@@ -169,18 +170,20 @@ public class FileHelper {
boolean flag = true;
//删除文件夹下的所有文件(包括子目录)
File[] files = dirFile.listFiles();
for (int i = 0; i < files.length; i++) {
//删除子文件
if (files[i].isFile()) {
flag = deleteFile(files[i].getAbsolutePath());
if (!flag) {
break;
}
} //删除子目录
else {
flag = deleteDirectory(files[i].getAbsolutePath());
if (!flag) {
break;
if (files != null) {
for (int i = 0; i < files.length; i++) {
//删除子文件
if (files[i].isFile()) {
flag = deleteFile(files[i].getAbsolutePath());
if (!flag) {
break;
}
} //删除子目录
else {
flag = deleteDirectory(files[i].getAbsolutePath());
if (!flag) {
break;
}
}
}
}
......
......@@ -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()) {
// 创建压缩文件实体
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment