Fix IllegalArgumentException: Folder parameter must be a valid folder

This commit is contained in:
huangyuhui
2018-03-05 20:36:38 +08:00
parent a03e3fea12
commit eb1a109afc
3 changed files with 7 additions and 3 deletions

View File

@@ -70,10 +70,10 @@ public final class ZipEngine implements Closeable {
* modified pathName, null if you dont want this file zipped
*/
private void putDirectoryImpl(File source, String basePath, BiFunction<String, Boolean, String> pathNameCallback) throws IOException {
File[] files;
File[] files = null;
if (source.isDirectory())
files = source.listFiles();
else
else if (source.isFile())
files = new File[] { source };
if (files == null)