From 25ec0ddb73a697fcc1e069e8a62b75472b6c702d Mon Sep 17 00:00:00 2001 From: noble Date: Fri, 11 Oct 2019 11:47:39 +1100 Subject: [PATCH] SOLR-13821: Incorrect file path escape in windows --- .../java/org/apache/solr/filestore/DistribPackageStore.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/solr/core/src/java/org/apache/solr/filestore/DistribPackageStore.java b/solr/core/src/java/org/apache/solr/filestore/DistribPackageStore.java index 910f29b5b0c..4e86926150f 100644 --- a/solr/core/src/java/org/apache/solr/filestore/DistribPackageStore.java +++ b/solr/core/src/java/org/apache/solr/filestore/DistribPackageStore.java @@ -89,13 +89,13 @@ public class DistribPackageStore implements PackageStore { @Override public Path getRealpath(String path) { if (File.separatorChar == '\\') { - path = path.replaceAll("/", File.separator); + path = path.replace('/' , File.separatorChar); } if (path.charAt(0) != File.separatorChar) { path = File.separator + path; } return new File(this.coreContainer.getResourceLoader().getInstancePath() + - "/" + PackageStoreAPI.PACKAGESTORE_DIRECTORY + path).toPath(); + File.separator + PackageStoreAPI.PACKAGESTORE_DIRECTORY + path).toPath(); } class FileInfo {