From 58a8a2a628315fc7be6d1057f9fc7fe2a9c2d26d Mon Sep 17 00:00:00 2001 From: Greg DiCristofaro Date: Tue, 16 Mar 2021 10:53:12 -0400 Subject: [PATCH] bug fixes --- .../ui/Bundle.properties-MERGED | 6 ++++ .../datasourcesummary/ui/ContainerPanel.java | 2 +- .../ui/IngestJobExcelExport.java | 28 ++++++++++++------- .../datasourcesummary/ui/TypesPanel.java | 8 +++--- 4 files changed, 29 insertions(+), 15 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/Bundle.properties-MERGED b/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/Bundle.properties-MERGED index 04dc52f280..4a47bcb092 100644 --- a/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/Bundle.properties-MERGED +++ b/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/Bundle.properties-MERGED @@ -87,6 +87,12 @@ GeolocationPanel_mostCommon_tabName=Most Common Cities GeolocationPanel_mostRecent_tabName=Most Recent Cities GeolocationPanel_onNoCrIngest_message=No results will be shown because the GPX Parser was not run. 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_countColumn_title=Count PastCasesPanel_notableFileTable_tabName=Cases with Common Notable diff --git a/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/ContainerPanel.java b/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/ContainerPanel.java index b74c083e61..affba43a61 100644 --- a/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/ContainerPanel.java +++ b/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/ContainerPanel.java @@ -337,7 +337,7 @@ class ContainerPanel extends BaseDataSourceSummaryPanel { ((DefaultTableModel) filePathsTable.getModel()).addRow(new Object[]{path}); } - md5HashLabel.setText(viewModel.getMd5Hash()); + md5HashValue.setText(viewModel.getMd5Hash()); sha1HashValue.setText(viewModel.getSha1Hash()); sha256HashValue.setText(viewModel.getSha256Hash()); } diff --git a/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/IngestJobExcelExport.java b/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/IngestJobExcelExport.java index 62cb484e54..51e0407286 100644 --- a/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/IngestJobExcelExport.java +++ b/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/IngestJobExcelExport.java @@ -105,7 +105,7 @@ class IngestJobExcelExport { (entry) -> new DefaultCellModel<>(entry.getIngestModuleVersion())) ); - private static DefaultCellModel getDateCell(Date date) { + private static DefaultCellModel getDateCell(Date date) { Function dateParser = (dt) -> dt == null ? "" : DATETIME_FORMAT.format(dt); return new DefaultCellModel<>(date, dateParser, DATETIME_FORMAT_STR); } @@ -118,11 +118,19 @@ class IngestJobExcelExport { Date startTime = job.getStartDateTime(); Date endTime = job.getEndDateTime(); String status = job.getStatus().getDisplayName(); - + return infoList.stream() .filter(info -> info != null) .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()); } } @@ -137,7 +145,7 @@ class IngestJobExcelExport { return new IngestJobEntry(null, null, null, entry.getIngestModule(), entry.getIngestModuleVersion()); } }); - + } static List getExports(DataSource dataSource) { @@ -151,18 +159,18 @@ class IngestJobExcelExport { } catch (NoCurrentCaseException | TskCoreException ex) { logger.log(Level.WARNING, "There was an error fetching ingest jobs", ex); } - + if (info == null) { info = Collections.emptyList(); } - + List toDisplay = info.stream() .filter(job -> job != null && dataSource.getId() == job.getObjectId()) - .sorted((a,b) -> { + .sorted((a, b) -> { boolean aIsNull = a.getStartDateTime() == null; boolean bIsNull = b.getStartDateTime() == null; if (aIsNull || bIsNull) { - return Boolean.compare(bIsNull, aIsNull); + return Boolean.compare(aIsNull, bIsNull); } else { return a.getStartDateTime().compareTo(b.getStartDateTime()); } @@ -172,7 +180,7 @@ class IngestJobExcelExport { .flatMap((lst) -> showFirstRowOnly(lst)) .filter(item -> item != null) .collect(Collectors.toList()); - - return Arrays.asList(new ExcelTableExport(Bundle.IngestJobExcelExport_sheetName(), COLUMNS, toDisplay)); + + return Arrays.asList(new ExcelTableExport<>(Bundle.IngestJobExcelExport_sheetName(), COLUMNS, toDisplay)); } } diff --git a/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/TypesPanel.java b/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/TypesPanel.java index b63150814a..c7e90e5072 100644 --- a/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/TypesPanel.java +++ b/Core/src/org/sleuthkit/autopsy/datasourcesummary/ui/TypesPanel.java @@ -281,13 +281,13 @@ class TypesPanel extends BaseDataSourceSummaryPanel { (dataSource) -> getMimeTypeCategoriesModel(mimeTypeData, dataSource), this::showMimeTypeCategories), 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, - countRes -> unallocatedLabel.showDataFetchResult(DataFetchResult.getSubResult(countRes, this::getStringOrZero))), + countRes -> unallocatedLabel.showDataFetchResult(DataFetchResult.getSubResult(countRes, (count) -> getStringOrZero(count)))), 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, - countRes -> directoriesLabel.showDataFetchResult(DataFetchResult.getSubResult(countRes, this::getStringOrZero))) + countRes -> directoriesLabel.showDataFetchResult(DataFetchResult.getSubResult(countRes, (count) -> getStringOrZero(count)))) ); initComponents();