fix for zip empty dir
This commit is contained in:
parent
1ee74058a2
commit
74a6d38d24
|
@ -24,6 +24,13 @@ public class ZipDirectory {
|
|||
return;
|
||||
}
|
||||
if (fileToZip.isDirectory()) {
|
||||
if (fileName.endsWith("/")) {
|
||||
zipOut.putNextEntry(new ZipEntry(fileName));
|
||||
zipOut.closeEntry();
|
||||
} else {
|
||||
zipOut.putNextEntry(new ZipEntry(fileName + "/"));
|
||||
zipOut.closeEntry();
|
||||
}
|
||||
final File[] children = fileToZip.listFiles();
|
||||
for (final File childFile : children) {
|
||||
zipFile(childFile, fileName + "/" + childFile.getName(), zipOut);
|
||||
|
|
Loading…
Reference in New Issue