From 3d9754121d2a0be7e6ef59da4dfb2d6e9e5612a9 Mon Sep 17 00:00:00 2001 From: mhmdchebbi Date: Mon, 12 Jan 2026 23:36:37 +0100 Subject: [PATCH] FELIX-6806 --- .../apache/felix/framework/cache/BundleCache.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/framework/src/main/java/org/apache/felix/framework/cache/BundleCache.java b/framework/src/main/java/org/apache/felix/framework/cache/BundleCache.java index 4f561e931f..44752bced5 100644 --- a/framework/src/main/java/org/apache/felix/framework/cache/BundleCache.java +++ b/framework/src/main/java/org/apache/felix/framework/cache/BundleCache.java @@ -31,6 +31,9 @@ import java.lang.ref.SoftReference; import java.nio.channels.FileChannel; import java.nio.channels.FileLock; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -589,6 +592,15 @@ private static File determineCacheDir(Map configMap) // Check to see if the cache directory is specified in the storage // configuration property. String cacheDirStr = (String) configMap.get(Constants.FRAMEWORK_STORAGE); + + Path cacheDirPath = Paths.get("cacheDirStr"); + try { + Path realCacheDirPath = cacheDirPath.toRealPath(); + cacheDirStr = realCacheDirPath.toString(); + } catch (IOException e) { + throw new RuntimeException(e); + } + // Get the cache root directory for relative paths; the default is ".". String rootDirStr = (String) configMap.get(CACHE_ROOTDIR_PROP); rootDirStr = (rootDirStr == null) ? CACHE_ROOTDIR_DEFAULT : rootDirStr;