|
|
|
@ -27,9 +27,26 @@ public class UpdateFileUtils {
|
|
|
|
|
List<String> versions = new ArrayList<>(); |
|
|
|
|
if (versionBackup != null) { |
|
|
|
|
for (File file : versionBackup) { |
|
|
|
|
if (file.isDirectory() && file.length() > 0) { |
|
|
|
|
versions.add(file.getName()); |
|
|
|
|
} else { |
|
|
|
|
boolean canBackup = true; |
|
|
|
|
if (file.isDirectory()) { |
|
|
|
|
File[] libs = file.listFiles(); |
|
|
|
|
if (libs == null || libs.length == 0) { |
|
|
|
|
canBackup = false; |
|
|
|
|
} else { |
|
|
|
|
for (File lib : libs) { |
|
|
|
|
if (lib.isDirectory()) { |
|
|
|
|
File[] jars = lib.listFiles(); |
|
|
|
|
if (jars == null || jars.length == 0) { |
|
|
|
|
canBackup = false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (canBackup) { |
|
|
|
|
versions.add(file.getName()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (!canBackup) { |
|
|
|
|
StableUtils.deleteFile(file); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|