[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:
Stephen Connolly committed 2017-04-19 14:04:33 +01:00
1 parent 33942677d4
commit 3871d7778e
31 files changed
+209 -46

No files matched your search

+6 -2
View File
@@ -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);
}
}
/**