Skip to content

Commit

Permalink
Flex: add try catch for traversing parent dirs
Browse files Browse the repository at this point in the history
  • Loading branch information
dgault committed May 10, 2024
1 parent 8eb67df commit 0feec6f
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions components/formats-gpl/src/loci/formats/in/FlexReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,23 @@ protected void initFile(String id) throws FormatException, IOException {
if (!dir.getName().startsWith("Meas_") || !groupPlates()) {
runDirs.add(dir);
}
else {
try {
// look for other acquisitions of the same plate
dir = dir.getParentFile();
String[] parentDirs = dir.list(true);
Arrays.sort(parentDirs);
for (String d : parentDirs) {
Location f = new Location(dir.getAbsoluteFile(), d);
if (f.isDirectory() && d.startsWith("Meas_")) {
runDirs.add(f);
}
}
}
catch (Exception e) {
LOGGER.error("Error while traversing parent directories: ", e);
}
}

runCount = runDirs.size();
if (runCount == 0) runCount = 1;
Expand Down

0 comments on commit 0feec6f

Please sign in to comment.