Skip to content
Snippets Groups Projects
Commit d83b748a authored by kohleman's avatar kohleman
Browse files

bugfix: handle error when no file matches regexp

SVN: 21261
parent 5d1033de
No related branches found
No related tags found
No related merge requests found
......@@ -85,11 +85,11 @@ public class FileBasedImageAnalysisGraphReportingPlugin extends AbstractDataMerg
{
final File dir = getDataSubDir(context.getDirectoryProvider(), dataset);
List<File> matchingFiles = findMatchingFiles(dataset, dir);
if (matchingFiles.size() > 1)
if (matchingFiles.size() != 1)
{
throw UserFailureException.fromTemplate(
"Found multiple candidate files in the dataset %s ",
dataset.getDataSetCode());
"Expected exactly one matching file in the dataset %s but found %d", dataset
.getDataSetCode(), matchingFiles.size());
}
builder.addRow(createRow(dataset, matchingFiles.get(0)));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment