Skip to content
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

Issue 856: refactoring of how filenames are chosen for Detailed Summary #894

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/main/java/network/brightspots/rcv/AuditableFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,17 @@
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;

final class AuditableFile extends File {
public AuditableFile(String pathname) {
super(pathname);
}

public AuditableFile(Path pathname) {
super(pathname.toAbsolutePath().toString());
}

public void finalizeAndHash() {
String hash = Utils.bytesToHex(FileUtils.getHashBytes(this, "SHA-512"));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ private void watchParseCvrServiceProgress(Service<LoadedCvrData> service) {
// and calculate the width of the filename column
perSourceCvrCountTable.getItems().clear();
int maxFilenameLength = 0;
for (ResultsWriter.CvrSourceData sourceData : data.getCvrSourcesData()) {
for (OutputWriter.CvrSourceData sourceData : data.getCvrSourcesData()) {
String countString = String.format("%,d", sourceData.getNumCvrs());
String fileString = new File(sourceData.source.getFilePath()).getName();
perSourceCvrCountTable.getItems().add(new Pair<>(fileString, countString));
Expand Down
Loading
Loading