@@ -0,0 +1,1313 @@
+// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.%0Apackage com.yahoo.vespa.hosted.node.admin.task.util.file;%0A%0Aimport com.yahoo.vespa.hosted.node.admin.component.TaskContext;%0A%0Aimport java.nio.file.Path;%0Aimport java.time.Instant;%0Aimport java.util.Optional;%0Aimport java.util.OptionalDouble;%0Aimport java.util.function.Supplier;%0Aimport java.util.logging.Logger;%0A%0A/**%0A * Class wrapping a float stored on disk%0A *%0A * @author freva%0A */%0Apublic class StoredDouble implements Supplier%3COptionalDouble%3E %7B%0A%0A    private static final Logger logger = Logger.getLogger(StoredDouble.class.getName());%0A%0A    private final UnixPath path;%0A%0A    public StoredDouble(Path path) %7B%0A        this.path = new UnixPath(path);%0A    %7D%0A%0A    @Override%0A    public OptionalDouble get() %7B%0A        return path.readUtf8FileIfExists().stream().mapToDouble(Double::parseDouble).findAny();%0A    %7D%0A%0A    public void write(TaskContext taskContext, double value) %7B%0A        path.writeUtf8File(Double.toString(value));%0A        taskContext.log(logger, %22Stored new double in %25s: %25f%22, path, value);%0A    %7D%0A%0A    public void clear() %7B%0A        path.deleteIfExists();%0A    %7D%0A%0A    public Optional%3CInstant%3E getLastModifiedTime() %7B%0A        return path.getAttributesIfExists().map(FileAttributes::lastModifiedTime);%0A    %7D%0A%0A%7D%0A

Create StoredDouble