Permalink
Browse files

Fix JENKINS-15059

  • Loading branch information...
gboissinot committed Sep 6, 2012
1 parent b67246d commit 1710ef63c7bfb8fe3a320b16fa53c1e39fcf13e8
@@ -214,9 +214,15 @@ public void onDeleted(AbstractBuild build) {
remoteArtifactPath.deleteRecursive();
}

if (remoteArtifactPath.getParent().exists() && remoteArtifactPath.getParent().list().size() == 0) {
remoteArtifactPath.getParent().delete();
}
FilePath parent = remoteArtifactPath.getParent();
boolean rest;
do {
rest = parent.exists() && parent.list().size() == 0;
if (rest) {
parent.delete();
}
parent = parent.getParent();
} while (rest);

} catch (IOException ioe) {
logger.log(Level.SEVERE, "Error when deleting artifacts.", ioe);

0 comments on commit 1710ef6

Please sign in to comment.