summaryrefslogtreecommitdiffstats
path: root/node-admin
diff options
context:
space:
mode:
authorHåkon Hallingstad <hakon@oath.com>2018-11-26 09:35:05 +0100
committerHåkon Hallingstad <hakon@oath.com>2018-11-26 09:35:05 +0100
commit39a5fb33dada81891d9082e0a5d616efe62c4c06 (patch)
treea22e2bd57f35f3d196976cdfee1492f63bf21df8 /node-admin
parent1e3df1dcc8456c6f1df160eb346afd2385eaa00b (diff)
Allow ignoring any IOException
Diffstat (limited to 'node-admin')
-rw-r--r--node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/file/UnixPath.java4
1 files changed, 2 insertions, 2 deletions
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 073d50aeb5d..0b24a37af14 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
@@ -26,8 +26,8 @@ import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
-import static com.yahoo.yolean.Exceptions.ifExists;
import static com.yahoo.yolean.Exceptions.uncheck;
+import static com.yahoo.yolean.Exceptions.uncheckAndIgnore;
/**
* Thin wrapper around java.nio.file.Path, especially nice for UNIX-specific features.
@@ -128,7 +128,7 @@ public class UnixPath {
}
public Optional<FileAttributes> getAttributesIfExists() {
- return ifExists(this::getAttributes);
+ return Optional.ofNullable(uncheckAndIgnore(this::getAttributes, NoSuchFileException.class));
}
public UnixPath createNewFile() {