19 package org.sleuthkit.autopsy.datasourcesummary.datamodel;
22 import java.util.stream.Collectors;
23 import org.apache.commons.lang3.StringUtils;
24 import org.openide.util.NbBundle.Messages;
36 "IngestModuleCheckUtil_recentActivityModuleName=Recent Activity",
40 public static final String RECENT_ACTIVITY_FACTORY =
"org.sleuthkit.autopsy.recentactivity.RecentActivityExtracterModuleFactory";
41 public static final String RECENT_ACTIVITY_MODULE_NAME = Bundle.IngestModuleCheckUtil_recentActivityModuleName();
44 private static final String UNIQUE_NAME_SEPARATOR =
"-";
66 this.caseProvider = provider;
80 String qualifiedName = info.getUniqueName();
81 if (StringUtils.isBlank(qualifiedName)) {
85 return qualifiedName.split(UNIQUE_NAME_SEPARATOR)[0];
95 private static boolean hasIngestModule(IngestJobInfo info, String fullyQualifiedFactory) {
96 if (info == null || info.getIngestModuleInfo() == null || StringUtils.isBlank(fullyQualifiedFactory)) {
100 return info.getIngestModuleInfo().stream()
101 .anyMatch((moduleInfo) -> {
102 String thisQualifiedFactory = getFullyQualifiedFactory(moduleInfo);
103 return fullyQualifiedFactory.equalsIgnoreCase(thisQualifiedFactory);
117 if (dataSource == null) {
121 long dataSourceId = dataSource.getId();
123 return caseProvider.
get().getIngestJobs().stream()
124 .anyMatch((ingestJob) -> {
125 return ingestJob != null
126 && ingestJob.getObjectId() == dataSourceId
127 && hasIngestModule(ingestJob, fullyQualifiedFactory);
139 return skCase.getIngestJobs().stream()
140 .flatMap(ingestJob -> ingestJob.getIngestModuleInfo().stream())
141 .collect(Collectors.toMap(
142 (moduleInfo) -> getFullyQualifiedFactory(moduleInfo),
143 (moduleInfo) -> moduleInfo.getDisplayName(),
SleuthkitCaseProvider DEFAULT
static Map< String, String > getFactoryDisplayNames(SleuthkitCase skCase)
final SleuthkitCaseProvider caseProvider
static String getFullyQualifiedFactory(IngestModuleInfo info)
boolean isModuleIngested(DataSource dataSource, String fullyQualifiedFactory)
IngestModuleCheckUtil(SleuthkitCaseProvider provider)
static boolean hasIngestModule(IngestJobInfo info, String fullyQualifiedFactory)