diff options
author | Valerij Fredriksen <valerijf@yahooinc.com> | 2022-05-25 14:07:44 +0200 |
---|---|---|
committer | Valerij Fredriksen <valerijf@yahooinc.com> | 2022-05-25 15:53:22 +0200 |
commit | 6024c19db7858d49d783f53b765709399598bc51 (patch) | |
tree | 2a6d044afab88351bcd1735b8b364f8bee6418e7 /node-admin | |
parent | 69bb4e0e94cd71aec2b6b20ba146e40394c8a087 (diff) |
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.java | 6 |
1 files changed, 2 insertions, 4 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 1f757bd6aba..f43995602fa 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,8 +7,6 @@ import java.io.UncheckedIOException; import java.nio.file.NoSuchFileException; import java.util.Optional; -import static com.yahoo.yolean.Exceptions.uncheck; - /** * Utils related to IOException. * @@ -19,9 +17,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.SupplierThrowingIOException<T> supplier) { + public static <T> Optional<T> ifExists(Exceptions.SupplierThrowingException<T> supplier) { try { - return Optional.ofNullable(uncheck(supplier)); + return Optional.ofNullable(Exceptions.uncheck(supplier)); } catch (UncheckedIOException e) { if (e.getCause() instanceof NoSuchFileException) { return Optional.empty(); |