diff options
author | Håkon Hallingstad <hakon@verizonmedia.com> | 2019-06-14 20:38:19 +0200 |
---|---|---|
committer | Håkon Hallingstad <hakon@verizonmedia.com> | 2019-06-14 20:38:19 +0200 |
commit | 02dff33ff6f062a687266bc45f2e36c0183df71a (patch) | |
tree | 8247f58d1bf48f03c76d63654ddc34158bd5bf7b /node-admin | |
parent | bb109275b0c35f88eed0808f2cbe26daaedc37d3 (diff) |
Use UncheckedIOException
Diffstat (limited to 'node-admin')
2 files changed, 10 insertions, 3 deletions
diff --git a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/file/StoredBoolean.java b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/file/StoredBoolean.java index 8edf5f7dcbd..9aee793b11a 100644 --- a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/file/StoredBoolean.java +++ b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/file/StoredBoolean.java @@ -35,6 +35,15 @@ public class StoredBoolean { } } + /** Sets value to true. */ + public void set(TaskContext context, boolean value) { + if (value) { + set(context); + } else { + clear(context); + } + } + /** Sets value to false. */ public void clear(TaskContext context) { if (value()) { diff --git a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/file/UnixPath.java b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/file/UnixPath.java index cd008c5bdfc..376fda1d2dc 100644 --- a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/file/UnixPath.java +++ b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/file/UnixPath.java @@ -1,8 +1,6 @@ // Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.hosted.node.admin.task.util.file; -import org.eclipse.jetty.io.RuntimeIOException; - import java.io.IOException; import java.io.UncheckedIOException; import java.nio.charset.StandardCharsets; @@ -66,7 +64,7 @@ public class UnixPath { } catch (NoSuchFileException ignored) { return Optional.empty(); } catch (IOException e) { - throw new RuntimeIOException(e); + throw new UncheckedIOException(e); } } |