-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
898: Dominion CvrExport parsing #899
base: develop
Are you sure you want to change the base?
Conversation
Ha, my bad, should have coordinated this better! I like this solution. One request: can you rename |
matchedCvrFiles.add(file); | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything above, up to the else, can be simplified with:
String regexPath = CVR_EXPORT_PATTERN.replaceAll("%d", "\\\\d+");
File cvrDirectory = new File(cvrPath);
File[] files = cvrDirectory.listFiles((dir, name) -> name.matches(pattern));
which has the added benefit of not duplicating the Cvr_Export
string
while (cvrFilePath.toFile().exists()) { | ||
HashMap json = JsonParser.readFromFile(cvrFilePath.toString(), HashMap.class); | ||
|
||
for (File file : matchedCvrFiles) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could order of files read matter here? I fear it might with some of the randomizers, but not totally sure if any randomizer works at the CVR level.
For safety, I might sort the matchedCvrFiles
just in case it does matter, now or later, so we generate the records in a deterministic order.
fixes #898