Skip to content

Commit

Permalink
Revert "revert getUsedFiles behaviour to remove skipPixels"
Browse files Browse the repository at this point in the history
This reverts commit 8aee5d8.

# Conflicts:
#	src/loci/formats/in/ZarrReader.java
  • Loading branch information
dgault committed Oct 4, 2023
1 parent 82ac198 commit b20ef9c
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/loci/formats/in/ZarrReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -1089,10 +1089,17 @@ public String[] getUsedFiles(boolean noPixels) {
FormatTools.assertId(currentId, true, 1);
String zarrRootPath = currentId.substring(0, currentId.indexOf(".zarr") + 5);
ArrayList<String> usedFiles = new ArrayList<String>();
try (Stream<Path> paths = Files.walk(Paths.get(zarrRootPath), FileVisitOption.FOLLOW_LINKS)) {
paths.filter(Files::isRegularFile)
.forEach(path -> usedFiles.add(path.toFile().getAbsolutePath()));

boolean skipPixels = noPixels || !listPixels();
LOGGER.error("ZarrReader getUsed files, skipPixels: {}", skipPixels);
LOGGER.error("ZarrReader fetching list of used files: {}", zarrRootPath);
try (Stream<Path> paths = Files.walk(Paths.get(zarrRootPath), FileVisitOption.FOLLOW_LINKS)) {
paths.filter(Files::isRegularFile)
.forEach(path -> {if (!skipPixels ||
(skipPixels && (path.endsWith(".zgroup") || path.endsWith(".zattrs") || path.endsWith(".xml"))))
usedFiles.add(path.toFile().getAbsolutePath());
LOGGER.error("Adding to the used files list: {}", path.toFile().getAbsolutePath());
});
} catch (IOException e) {
e.printStackTrace();
}
Expand Down

0 comments on commit b20ef9c

Please sign in to comment.