gradle: check existing corrupted gradle dist zip before test

This commit is contained in:
Vladislav.Soroka
2016-10-28 15:07:57 +03:00
parent 861ee6c819
commit b91c3fc586
@@ -252,13 +252,17 @@ public abstract class GradleImportingTestCase extends ExternalSystemImportingTes
File zip = localDistribution.getZipFile();
try {
ZipFile zipFile = new ZipFile(zip);
zipFile.close();
if(zip.exists()) {
ZipFile zipFile = new ZipFile(zip);
zipFile.close();
}
}
catch (ZipException e) {
e.printStackTrace();
System.out.println("Corrupted file will be removed: " + zip.getPath());
FileUtil.delete(zip);
} catch (IOException e) {
e.printStackTrace();
}
}