You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by GitBox <gi...@apache.org> on 2022/12/14 03:29:58 UTC
[GitHub] [solr] dsmiley commented on a diff in pull request #1239: SOLR-15787: Fix FileSystemConfigSetService test failure
dsmiley commented on code in PR #1239:
URL: https://github.com/apache/solr/pull/1239#discussion_r1047975716
##########
solr/core/src/java/org/apache/solr/core/FileSystemConfigSetService.java:
##########
@@ -238,9 +238,11 @@ public List<String> getAllConfigFiles(String configName) throws IOException {
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs)
throws IOException {
- // don't include hidden (.) files
- if (!Files.isHidden(file)) {
- filePaths.add(configDir.relativize(file).toString());
+ String filePath = configDir.relativize(file).toString();
+ filePath = filePath.replace('\\', '/'); // normalize slashes
+ // don't include .metadata.json hidden file
+ if (!filePath.startsWith(METADATA_FILE)) {
Review Comment:
Why startsWith instead of equals?
##########
solr/core/src/java/org/apache/solr/core/FileSystemConfigSetService.java:
##########
@@ -238,9 +238,11 @@ public List<String> getAllConfigFiles(String configName) throws IOException {
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs)
throws IOException {
- // don't include hidden (.) files
- if (!Files.isHidden(file)) {
- filePaths.add(configDir.relativize(file).toString());
+ String filePath = configDir.relativize(file).toString();
+ filePath = filePath.replace('\\', '/'); // normalize slashes
Review Comment:
I think that backslash is `path.getFileSystem().getSeparator()`. In theory, we could be running on some new system that uses some other symbol and this method would return it; it'd be found in the path.toString as the separator.
--
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-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org