HoustonPutman commented on code in PR #2924: URL: https://github.com/apache/solr/pull/2924#discussion_r1943584596
########## solr/core/src/java/org/apache/solr/filestore/DistribFileStore.java: ########## @@ -80,19 +80,21 @@ public DistribFileStore(CoreContainer coreContainer) { } @Override - public Path getRealpath(String path) { + public Path getRealPath(String path) { return _getRealPath(path, solrHome); } - private static Path _getRealPath(String path, Path solrHome) { - if (File.separatorChar == '\\') { - path = path.replace('/', File.separatorChar); - } - SolrPaths.assertNotUnc(Path.of(path)); - while (path.startsWith(File.separator)) { // Trim all leading slashes - path = path.substring(1); + private static Path _getRealPath(String dir, Path solrHome) { + Path path = Path.of(dir); + SolrPaths.assertNotUnc(path); + + if (path.isAbsolute()) { + // Strip the path of from being absolute to become relative to resolve with SolrHome + path = path.subpath(0, path.getNameCount()); } Review Comment: This is broken on Windows. A number of tests fail because it's not stripping leading "\" characters. Not sure if we should revert to the previous logic, or do it another way. I made https://issues.apache.org/jira/browse/SOLR-17654, but it seems this is a new thing, so we can probably close that. @mlbiscoc -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org