bug fixes

This commit is contained in:
Greg DiCristofaro 2021-03-16 10:53:12 -04:00
parent 62b2628064
commit 58a8a2a628
4 changed files with 29 additions and 15 deletions

View File

@ -87,6 +87,12 @@ GeolocationPanel_mostCommon_tabName=Most Common Cities
GeolocationPanel_mostRecent_tabName=Most Recent Cities GeolocationPanel_mostRecent_tabName=Most Recent Cities
GeolocationPanel_onNoCrIngest_message=No results will be shown because the GPX Parser was not run. GeolocationPanel_onNoCrIngest_message=No results will be shown because the GPX Parser was not run.
GeolocationPanel_unknownRow_title=Unknown GeolocationPanel_unknownRow_title=Unknown
IngestJobExcelExport_endTimeColumn=End Time
IngestJobExcelExport_ingestStatusTimeColumn=Ingest Status
IngestJobExcelExport_moduleNameTimeColumn=Module Name
IngestJobExcelExport_sheetName=Ingest History
IngestJobExcelExport_startTimeColumn=Start Time
IngestJobExcelExport_versionColumn=Module Version
PastCasesPanel_caseColumn_title=Case PastCasesPanel_caseColumn_title=Case
PastCasesPanel_countColumn_title=Count PastCasesPanel_countColumn_title=Count
PastCasesPanel_notableFileTable_tabName=Cases with Common Notable PastCasesPanel_notableFileTable_tabName=Cases with Common Notable

View File

@ -337,7 +337,7 @@ class ContainerPanel extends BaseDataSourceSummaryPanel {
((DefaultTableModel) filePathsTable.getModel()).addRow(new Object[]{path}); ((DefaultTableModel) filePathsTable.getModel()).addRow(new Object[]{path});
} }
md5HashLabel.setText(viewModel.getMd5Hash()); md5HashValue.setText(viewModel.getMd5Hash());
sha1HashValue.setText(viewModel.getSha1Hash()); sha1HashValue.setText(viewModel.getSha1Hash());
sha256HashValue.setText(viewModel.getSha256Hash()); sha256HashValue.setText(viewModel.getSha256Hash());
} }

View File

@ -105,7 +105,7 @@ class IngestJobExcelExport {
(entry) -> new DefaultCellModel<>(entry.getIngestModuleVersion())) (entry) -> new DefaultCellModel<>(entry.getIngestModuleVersion()))
); );
private static DefaultCellModel getDateCell(Date date) { private static DefaultCellModel<?> getDateCell(Date date) {
Function<Date, String> dateParser = (dt) -> dt == null ? "" : DATETIME_FORMAT.format(dt); Function<Date, String> dateParser = (dt) -> dt == null ? "" : DATETIME_FORMAT.format(dt);
return new DefaultCellModel<>(date, dateParser, DATETIME_FORMAT_STR); return new DefaultCellModel<>(date, dateParser, DATETIME_FORMAT_STR);
} }
@ -118,11 +118,19 @@ class IngestJobExcelExport {
Date startTime = job.getStartDateTime(); Date startTime = job.getStartDateTime();
Date endTime = job.getEndDateTime(); Date endTime = job.getEndDateTime();
String status = job.getStatus().getDisplayName(); String status = job.getStatus().getDisplayName();
return infoList.stream() return infoList.stream()
.filter(info -> info != null) .filter(info -> info != null)
.map(info -> new IngestJobEntry(startTime, endTime, status, info.getDisplayName(), info.getVersion())) .map(info -> new IngestJobEntry(startTime, endTime, status, info.getDisplayName(), info.getVersion()))
.sorted((a,b) -> StringUtils.compareIgnoreCase(a.getIngestModule(), b.getIngestModule())) .sorted((a, b) -> {
boolean aIsNull = a == null || a.getIngestModule() == null;
boolean bIsNull = b == null || b.getIngestModule() == null;
if (aIsNull || bIsNull) {
return Boolean.compare(aIsNull, bIsNull);
} else {
return a.getIngestModule().compareTo(b.getIngestModule());
}
})
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
} }
@ -137,7 +145,7 @@ class IngestJobExcelExport {
return new IngestJobEntry(null, null, null, entry.getIngestModule(), entry.getIngestModuleVersion()); return new IngestJobEntry(null, null, null, entry.getIngestModule(), entry.getIngestModuleVersion());
} }
}); });
} }
static List<ExcelSheetExport> getExports(DataSource dataSource) { static List<ExcelSheetExport> getExports(DataSource dataSource) {
@ -151,18 +159,18 @@ class IngestJobExcelExport {
} catch (NoCurrentCaseException | TskCoreException ex) { } catch (NoCurrentCaseException | TskCoreException ex) {
logger.log(Level.WARNING, "There was an error fetching ingest jobs", ex); logger.log(Level.WARNING, "There was an error fetching ingest jobs", ex);
} }
if (info == null) { if (info == null) {
info = Collections.emptyList(); info = Collections.emptyList();
} }
List<IngestJobEntry> toDisplay = info.stream() List<IngestJobEntry> toDisplay = info.stream()
.filter(job -> job != null && dataSource.getId() == job.getObjectId()) .filter(job -> job != null && dataSource.getId() == job.getObjectId())
.sorted((a,b) -> { .sorted((a, b) -> {
boolean aIsNull = a.getStartDateTime() == null; boolean aIsNull = a.getStartDateTime() == null;
boolean bIsNull = b.getStartDateTime() == null; boolean bIsNull = b.getStartDateTime() == null;
if (aIsNull || bIsNull) { if (aIsNull || bIsNull) {
return Boolean.compare(bIsNull, aIsNull); return Boolean.compare(aIsNull, bIsNull);
} else { } else {
return a.getStartDateTime().compareTo(b.getStartDateTime()); return a.getStartDateTime().compareTo(b.getStartDateTime());
} }
@ -172,7 +180,7 @@ class IngestJobExcelExport {
.flatMap((lst) -> showFirstRowOnly(lst)) .flatMap((lst) -> showFirstRowOnly(lst))
.filter(item -> item != null) .filter(item -> item != null)
.collect(Collectors.toList()); .collect(Collectors.toList());
return Arrays.asList(new ExcelTableExport(Bundle.IngestJobExcelExport_sheetName(), COLUMNS, toDisplay)); return Arrays.asList(new ExcelTableExport<>(Bundle.IngestJobExcelExport_sheetName(), COLUMNS, toDisplay));
} }
} }

View File

@ -281,13 +281,13 @@ class TypesPanel extends BaseDataSourceSummaryPanel {
(dataSource) -> getMimeTypeCategoriesModel(mimeTypeData, dataSource), (dataSource) -> getMimeTypeCategoriesModel(mimeTypeData, dataSource),
this::showMimeTypeCategories), this::showMimeTypeCategories),
new DataFetchWorker.DataFetchComponents<>(allocatedFetcher, new DataFetchWorker.DataFetchComponents<>(allocatedFetcher,
countRes -> allocatedLabel.showDataFetchResult(DataFetchResult.getSubResult(countRes, this::getStringOrZero))), countRes -> allocatedLabel.showDataFetchResult(DataFetchResult.getSubResult(countRes, (count) -> getStringOrZero(count)))),
new DataFetchWorker.DataFetchComponents<>(unallocatedFetcher, new DataFetchWorker.DataFetchComponents<>(unallocatedFetcher,
countRes -> unallocatedLabel.showDataFetchResult(DataFetchResult.getSubResult(countRes, this::getStringOrZero))), countRes -> unallocatedLabel.showDataFetchResult(DataFetchResult.getSubResult(countRes, (count) -> getStringOrZero(count)))),
new DataFetchWorker.DataFetchComponents<>(slackFetcher, new DataFetchWorker.DataFetchComponents<>(slackFetcher,
countRes -> slackLabel.showDataFetchResult(DataFetchResult.getSubResult(countRes, this::getStringOrZero))), countRes -> slackLabel.showDataFetchResult(DataFetchResult.getSubResult(countRes, (count) -> getStringOrZero(count)))),
new DataFetchWorker.DataFetchComponents<>(directoriesFetcher, new DataFetchWorker.DataFetchComponents<>(directoriesFetcher,
countRes -> directoriesLabel.showDataFetchResult(DataFetchResult.getSubResult(countRes, this::getStringOrZero))) countRes -> directoriesLabel.showDataFetchResult(DataFetchResult.getSubResult(countRes, (count) -> getStringOrZero(count))))
); );
initComponents(); initComponents();