diff options
author | gjoranv <gv@verizonmedia.com> | 2020-07-14 01:26:18 +0200 |
---|---|---|
committer | gjoranv <gv@verizonmedia.com> | 2020-07-14 01:35:42 +0200 |
commit | 9131a39a9872b79c853c2c881c1c1b905428eda0 (patch) | |
tree | d76baebf1b2543b236106aae7ab80c1f76e46ce3 /config-model | |
parent | 26d00d9818553eee9b0bc05b7a8bd8c44f8c6a77 (diff) |
Make absoluteBundlePath method simpler to use
Diffstat (limited to 'config-model')
2 files changed, 4 insertions, 5 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/admin/metricsproxy/MetricsProxyContainerCluster.java b/config-model/src/main/java/com/yahoo/vespa/model/admin/metricsproxy/MetricsProxyContainerCluster.java index 86b6ab8a25c..cb844363887 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/admin/metricsproxy/MetricsProxyContainerCluster.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/admin/metricsproxy/MetricsProxyContainerCluster.java @@ -58,7 +58,6 @@ import static com.yahoo.vespa.model.admin.metricsproxy.MetricsProxyContainerClus import static com.yahoo.vespa.model.admin.monitoring.DefaultPublicConsumer.getDefaultPublicConsumer; import static com.yahoo.vespa.model.admin.monitoring.MetricSet.emptyMetricSet; import static com.yahoo.vespa.model.admin.monitoring.VespaMetricsConsumer.getVespaMetricsConsumer; -import static com.yahoo.vespa.model.container.xml.BundleMapper.JarSuffix.JAR_WITH_DEPS; import static com.yahoo.vespa.model.container.xml.BundleMapper.absoluteBundlePath; /** @@ -76,7 +75,7 @@ public class MetricsProxyContainerCluster extends ContainerCluster<MetricsProxyC public static final Logger log = Logger.getLogger(MetricsProxyContainerCluster.class.getName()); private static final String METRICS_PROXY_NAME = "metrics-proxy"; - static final Path METRICS_PROXY_BUNDLE_FILE = absoluteBundlePath((Paths.get(METRICS_PROXY_NAME + JAR_WITH_DEPS.suffix))); + static final Path METRICS_PROXY_BUNDLE_FILE = absoluteBundlePath(METRICS_PROXY_NAME); static final String METRICS_PROXY_BUNDLE_NAME = "com.yahoo.vespa." + METRICS_PROXY_NAME; static final class AppDimensionNames { diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/xml/BundleMapper.java b/config-model/src/main/java/com/yahoo/vespa/model/container/xml/BundleMapper.java index 8c7b06ce222..c7b94767d19 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/container/xml/BundleMapper.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/container/xml/BundleMapper.java @@ -15,7 +15,7 @@ import java.util.Optional; */ public class BundleMapper { - public enum JarSuffix { + private enum JarSuffix { JAR_WITH_DEPS("-jar-with-dependencies.jar"), DEPLOY("-deploy.jar"); @@ -36,9 +36,9 @@ public class BundleMapper { return Optional.ofNullable(bundleFromClass.get(className)); } - public static Path absoluteBundlePath(Path fileName) { + public static Path absoluteBundlePath(String fileName) { if (fileName == null) return null; - return LIBRARY_PATH.resolve(fileName); + return LIBRARY_PATH.resolve(Paths.get(fileName + JarSuffix.JAR_WITH_DEPS.suffix)); } //This is a hack to allow users to declare components from the search-and-docproc bundle without naming the bundle. |