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