mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-10-31 21:45:25 +00:00
[JENKINS-43531] Plugins may not be expecting InvalidPathException
- Plugins should really be expecting it, but as historically they have not, may as well convert to IOE for them
This commit is contained in:
1 parent
33942677d4
commit
3871d7778e
31 files changed
+209
-46
No files matched your search
@@ -30,6 +30,7 @@ import hudson.model.AdministrativeMonitor;
|
||||
import hudson.model.Api;
|
||||
import hudson.model.ModelObject;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.InvalidPathException;
|
||||
import jenkins.YesNoMaybe;
|
||||
import jenkins.model.Jenkins;
|
||||
import hudson.model.UpdateCenter;
|
||||
@@ -496,8 +497,11 @@ public class PluginWrapper implements Comparable<PluginWrapper>, ModelObject {
|
||||
*/
|
||||
public void disable() throws IOException {
|
||||
// creates an empty file
|
||||
OutputStream os = Files.newOutputStream(disableFile.toPath());
|
||||
os.close();
|
||||
try (OutputStream os = Files.newOutputStream(disableFile.toPath())) {
|
||||
os.close();
|
||||
} catch (InvalidPathException e) {
|
||||
throw new IOException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user