summaryrefslogtreecommitdiffstats
path: root/container-core
diff options
context:
space:
mode:
authorgjoranv <gv@verizonmedia.com>2020-07-17 18:48:53 +0200
committergjoranv <gv@verizonmedia.com>2020-07-17 18:48:53 +0200
commitc020e9a0ea5cb1f4130e6f12d510501bd33f7f40 (patch)
tree138db885e91f3e5987d804ab7781992608d0acfc /container-core
parent1395510686fd5252494e25e9e92eae9131dc60e1 (diff)
Drop the now unnecessary 'file:' prefix for disk bundles.
- It was originally used to separate between disk bundles and bundles retrieved with file distribution. - Keep conversion code until the last model producing 'file:' has rolled out of hosted.
Diffstat (limited to 'container-core')
-rw-r--r--container-core/src/main/java/com/yahoo/container/core/BundleLoaderProperties.java15
-rw-r--r--container-core/src/main/java/com/yahoo/container/core/config/DiskBundleInstaller.java8
2 files changed, 4 insertions, 19 deletions
diff --git a/container-core/src/main/java/com/yahoo/container/core/BundleLoaderProperties.java b/container-core/src/main/java/com/yahoo/container/core/BundleLoaderProperties.java
deleted file mode 100644
index ee12c7d4c9f..00000000000
--- a/container-core/src/main/java/com/yahoo/container/core/BundleLoaderProperties.java
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-package com.yahoo.container.core;
-
-/**
- * @author gjoranv
- */
-public interface BundleLoaderProperties {
-
- // TODO: This should be removed. The prefix is used to separate the bundles in BundlesConfig
- // into those that are transferred with filedistribution and those that are preinstalled
- // on disk. Instead, the model should have put them in two different configs. I.e. create a new
- // config 'preinstalled-bundles.def'.
- String DISK_BUNDLE_PREFIX = "file:";
-
-}
diff --git a/container-core/src/main/java/com/yahoo/container/core/config/DiskBundleInstaller.java b/container-core/src/main/java/com/yahoo/container/core/config/DiskBundleInstaller.java
index 3edabe9f861..87c3d3048c5 100644
--- a/container-core/src/main/java/com/yahoo/container/core/config/DiskBundleInstaller.java
+++ b/container-core/src/main/java/com/yahoo/container/core/config/DiskBundleInstaller.java
@@ -8,8 +8,6 @@ import org.osgi.framework.Bundle;
import java.io.File;
import java.util.List;
-import static com.yahoo.container.core.BundleLoaderProperties.DISK_BUNDLE_PREFIX;
-
/**
* @author gjoranv
*/
@@ -17,8 +15,10 @@ public class DiskBundleInstaller implements BundleInstaller {
@Override
public List<Bundle> installBundles(FileReference reference, Osgi osgi) {
- assert(reference.value().startsWith(DISK_BUNDLE_PREFIX));
- String referenceFileName = reference.value().substring(DISK_BUNDLE_PREFIX.length());
+ // TODO: remove when the last model producing 'file:' has rolled out of hosted
+ String referenceFileName = reference.value().startsWith("file:")
+ ? reference.value().substring("file:".length())
+ : reference.value();
File file = new File(referenceFileName);
if ( ! file.exists()) {