You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ds...@apache.org on 2020/06/27 16:23:50 UTC

[lucene-solr] branch master updated: SOLR Revert change in path separator exposed by cat() Previous change *should* have been purely a refactor but accidentally changed the path separator this streaming expression exposed to always be '/'. Apparently this is controversial so the previous behavior is re-instated here (and fixes a failing test on Windows).

This is an automated email from the ASF dual-hosted git repository.

dsmiley pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


The following commit(s) were added to refs/heads/master by this push:
     new 80bc86d  SOLR Revert change in path separator exposed by cat() Previous change *should* have been purely a refactor but accidentally  changed the path separator this streaming expression exposed to always be '/'.  Apparently this is controversial so the previous behavior is re-instated here (and fixes a failing test on Windows).
80bc86d is described below

commit 80bc86dd6a72a1c7aec3182ae5ab0a3d2372f5a2
Author: David Smiley <ds...@salesforce.com>
AuthorDate: Sat Jun 27 12:13:25 2020 -0400

    SOLR Revert change in path separator exposed by cat()
    Previous change *should* have been purely a refactor but accidentally  changed the path separator this streaming expression exposed to always be '/'.  Apparently this is controversial so the previous behavior is re-instated here (and fixes a failing test on Windows).
---
 solr/core/src/java/org/apache/solr/handler/CatStream.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/solr/core/src/java/org/apache/solr/handler/CatStream.java b/solr/core/src/java/org/apache/solr/handler/CatStream.java
index 0f11fdf..d7f5fe6 100644
--- a/solr/core/src/java/org/apache/solr/handler/CatStream.java
+++ b/solr/core/src/java/org/apache/solr/handler/CatStream.java
@@ -224,7 +224,9 @@ public class CatStream extends TupleStream implements Expressible {
     } else if (Files.isDirectory(entry)) {
       try (Stream<Path> directoryContents = Files.list(entry)) {
         directoryContents.sorted().forEach(iPath -> {
-          final String itemDisplayPath = seed.displayPath + "/" + iPath.getFileName();
+          // debatable: should the separator be OS/file-system specific, or perhaps always "/" ?
+          final String displayPathSeparator = iPath.getFileSystem().getSeparator();
+          final String itemDisplayPath = seed.displayPath + displayPathSeparator + iPath.getFileName();
           findReadableFiles(new CrawlFile(itemDisplayPath, iPath), foundFiles);
         });
       } catch (IOException e) {