mirror of https://github.com/apache/lucene.git
SOLR-13821: Incorrect file path escape in windows
This commit is contained in:
parent
d5b26be691
commit
25ec0ddb73
|
@ -89,13 +89,13 @@ public class DistribPackageStore implements PackageStore {
|
||||||
@Override
|
@Override
|
||||||
public Path getRealpath(String path) {
|
public Path getRealpath(String path) {
|
||||||
if (File.separatorChar == '\\') {
|
if (File.separatorChar == '\\') {
|
||||||
path = path.replaceAll("/", File.separator);
|
path = path.replace('/' , File.separatorChar);
|
||||||
}
|
}
|
||||||
if (path.charAt(0) != File.separatorChar) {
|
if (path.charAt(0) != File.separatorChar) {
|
||||||
path = File.separator + path;
|
path = File.separator + path;
|
||||||
}
|
}
|
||||||
return new File(this.coreContainer.getResourceLoader().getInstancePath() +
|
return new File(this.coreContainer.getResourceLoader().getInstancePath() +
|
||||||
"/" + PackageStoreAPI.PACKAGESTORE_DIRECTORY + path).toPath();
|
File.separator + PackageStoreAPI.PACKAGESTORE_DIRECTORY + path).toPath();
|
||||||
}
|
}
|
||||||
|
|
||||||
class FileInfo {
|
class FileInfo {
|
||||||
|
|
Loading…
Reference in New Issue