[HUDSON-4244] Making FilePath.delete throw IOException upon failure rather than return false.

Making Util.deleteFile public since it is useful.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@20816 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
jglick committed 2009-08-17 23:17:53 +00:00
1 parent a4bb163805
commit 2d8713a57c
2 files changed
+13 -4

No files matched your search

+7 -3
View File
@@ -899,13 +899,17 @@ public final class FilePath implements Serializable {
/**
* Deletes this file.
* @throws IOException if it exists but could not be successfully deleted
* @return true, for a modicum of compatibility
*/
public boolean delete() throws IOException, InterruptedException {
return act(new FileCallable<Boolean>() {
public Boolean invoke(File f, VirtualChannel channel) throws IOException {
return f.delete();
act(new FileCallable<Void>() {
public Void invoke(File f, VirtualChannel channel) throws IOException {
Util.deleteFile(f);
return null;
}
});
return true;
}
/**