Skip to content

Commit

Permalink
Fixes jenkinsci#214 by emptying the ref dir instead of deleting it
Browse files Browse the repository at this point in the history
  • Loading branch information
halkeye committed Oct 31, 2020
1 parent eec5429 commit f7c90f7
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,14 @@ public void start() {
public void start(boolean downloadUc) {
if (refDir.exists()) {
try {
FileUtils.deleteDirectory(refDir);
File[] toBeDeleted = refDir.listFiles();
for (File deletableFile : toBeDeleted ) {
if (deletableFile.isDirectory()) {
FileUtils.deleteDirectory(deletableFile);
} else {
deletableFile.delete();
}
}
} catch (IOException e) {
throw new UncheckedIOException("Unable to delete: " + refDir.getAbsolutePath(), e);
}
Expand Down

0 comments on commit f7c90f7

Please sign in to comment.