summaryrefslogtreecommitdiffstats
path: root/node-admin
diff options
context:
space:
mode:
authorValerij Fredriksen <freva@users.noreply.github.com>2022-05-30 09:24:53 +0200
committerGitHub <noreply@github.com>2022-05-30 09:24:53 +0200
commit29bbcf6e2c3cf7133a1109c51d93fedc7e493b97 (patch)
treef1eb4b6c9c08fc492d9568e7d3296f7b2cc58e16 /node-admin
parent9aebfc50b7f0f967bb68e5e6986bc03afc469bd5 (diff)
Revert "uncheck() all checked exceptions"
Diffstat (limited to 'node-admin')
-rw-r--r--node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/file/IOExceptionUtil.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/file/IOExceptionUtil.java b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/file/IOExceptionUtil.java
index f43995602fa..1f757bd6aba 100644
--- a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/file/IOExceptionUtil.java
+++ b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/file/IOExceptionUtil.java
@@ -7,6 +7,8 @@ import java.io.UncheckedIOException;
import java.nio.file.NoSuchFileException;
import java.util.Optional;
+import static com.yahoo.yolean.Exceptions.uncheck;
+
/**
* Utils related to IOException.
*
@@ -17,9 +19,9 @@ public class IOExceptionUtil {
* Useful if it's not known whether a file or directory exists, in case e.g.
* NoSuchFileException is thrown and the caller wants an Optional.empty() in that case.
*/
- public static <T> Optional<T> ifExists(Exceptions.SupplierThrowingException<T> supplier) {
+ public static <T> Optional<T> ifExists(Exceptions.SupplierThrowingIOException<T> supplier) {
try {
- return Optional.ofNullable(Exceptions.uncheck(supplier));
+ return Optional.ofNullable(uncheck(supplier));
} catch (UncheckedIOException e) {
if (e.getCause() instanceof NoSuchFileException) {
return Optional.empty();