summaryrefslogtreecommitdiffstats
path: root/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/component/PathResolver.java
diff options
context:
space:
mode:
Diffstat (limited to 'node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/component/PathResolver.java')
-rw-r--r--node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/component/PathResolver.java35
1 files changed, 35 insertions, 0 deletions
diff --git a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/component/PathResolver.java b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/component/PathResolver.java
new file mode 100644
index 00000000000..f70f451d33d
--- /dev/null
+++ b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/component/PathResolver.java
@@ -0,0 +1,35 @@
+// 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.component;
+
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+/**
+ * @author freva
+ */
+public class PathResolver {
+ public static final Path ROOT = Paths.get("/");
+ public static final Path RELATIVE_APPLICATION_STORAGE_PATH = Paths.get("home/docker/container-storage");
+
+ private final Path applicationStoragePathForNodeAdmin;
+ private final Path applicationStoragePathForHost;
+
+ public PathResolver() {
+ this(
+ Paths.get("/host").resolve(RELATIVE_APPLICATION_STORAGE_PATH),
+ ROOT.resolve(RELATIVE_APPLICATION_STORAGE_PATH));
+ }
+
+ public PathResolver(Path applicationStoragePathForNodeAdmin, Path applicationStoragePathForHost) {
+ this.applicationStoragePathForNodeAdmin = applicationStoragePathForNodeAdmin;
+ this.applicationStoragePathForHost = applicationStoragePathForHost;
+ }
+
+ public Path getApplicationStoragePathForNodeAdmin() {
+ return applicationStoragePathForNodeAdmin;
+ }
+
+ public Path getApplicationStoragePathForHost() {
+ return applicationStoragePathForHost;
+ }
+}