risdenk commented on code in PR #1239:
URL: https://github.com/apache/solr/pull/1239#discussion_r1048708781


##########
solr/core/src/java/org/apache/solr/core/FileSystemConfigSetService.java:
##########
@@ -238,9 +238,14 @@ 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());
+            Path filePath = configDir.relativize(file);
+            String filePathStr = filePath.toString();
+            filePathStr =
+                filePathStr.replace(
+                    filePath.getFileSystem().getSeparator(), "/"); // 
normalize slashes
+            // don't include .metadata.json hidden file
+            if (!filePathStr.equals(METADATA_FILE)) {
+              filePaths.add(filePathStr);

Review Comment:
   Since `METADATA_FILE` is a file - can't we just get the file from the path 
and compare that exactly? no need to worry about slashes at all? Specifically 
https://docs.oracle.com/javase/7/docs/api/java/nio/file/Path.html#getFileName() 
- this avoids the string comparison as well?



-- 
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

Reply via email to