mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-13 20:12:14 +00:00
[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:
1 parent
a4bb163805
commit
2d8713a57c
2 files changed
+13
-4
No files matched your search
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user