19 package org.sleuthkit.autopsy.centralrepository.contentviewer;
21 import java.awt.Component;
22 import java.awt.event.ActionEvent;
23 import java.awt.event.ActionListener;
24 import java.io.BufferedWriter;
26 import java.io.IOException;
27 import java.nio.file.Files;
28 import java.util.ArrayList;
29 import java.util.Calendar;
30 import java.util.Collection;
31 import java.util.HashMap;
32 import java.util.List;
34 import java.util.Objects;
35 import java.util.logging.Level;
37 import java.util.stream.Collectors;
38 import javax.swing.JFileChooser;
39 import javax.swing.JMenuItem;
40 import javax.swing.JOptionPane;
41 import static javax.swing.JOptionPane.DEFAULT_OPTION;
42 import static javax.swing.JOptionPane.PLAIN_MESSAGE;
43 import static javax.swing.JOptionPane.ERROR_MESSAGE;
44 import javax.swing.JPanel;
45 import javax.swing.filechooser.FileNameExtensionFilter;
46 import javax.swing.table.TableCellRenderer;
47 import javax.swing.table.TableColumn;
48 import org.openide.nodes.Node;
49 import org.openide.util.NbBundle.Messages;
50 import org.openide.util.lookup.ServiceProvider;
77 @SuppressWarnings(
"PMD.SingularField")
79 @Messages({
"DataContentViewerOtherCases.title=Other Occurrences",
80 "DataContentViewerOtherCases.toolTip=Displays instances of the selected file/artifact from other occurrences.",})
97 this.correlationAttributes =
new ArrayList<>();
100 customizeComponents();
105 ActionListener actList =
new ActionListener() {
107 public void actionPerformed(ActionEvent e) {
108 JMenuItem jmi = (JMenuItem) e.getSource();
109 if (jmi.equals(selectAllMenuItem)) {
110 otherCasesTable.selectAll();
111 }
else if (jmi.equals(showCaseDetailsMenuItem)) {
112 showCaseDetails(otherCasesTable.getSelectedRow());
113 }
else if (jmi.equals(exportToCSVMenuItem)) {
117 logger.log(Level.SEVERE,
"Exception while getting open case.", ex);
119 }
else if (jmi.equals(showCommonalityMenuItem)) {
120 showCommonalityDetails();
121 }
else if (jmi.equals(addCommentMenuItem)) {
125 otherCasesTable.repaint();
130 exportToCSVMenuItem.addActionListener(actList);
131 selectAllMenuItem.addActionListener(actList);
132 showCaseDetailsMenuItem.addActionListener(actList);
133 showCommonalityMenuItem.addActionListener(actList);
134 addCommentMenuItem.addActionListener(actList);
138 otherCasesTable.setDefaultRenderer(Object.class, renderer);
139 tableStatusPanelLabel.setVisible(
false);
142 @Messages({
"DataContentViewerOtherCases.correlatedArtifacts.isEmpty=There are no files or artifacts to correlate.",
143 "# {0} - commonality percentage",
144 "# {1} - correlation type",
145 "# {2} - correlation value",
146 "DataContentViewerOtherCases.correlatedArtifacts.byType={0}% of data sources have {2} (type: {1})\n",
147 "DataContentViewerOtherCases.correlatedArtifacts.title=Attribute Frequency",
148 "DataContentViewerOtherCases.correlatedArtifacts.failed=Failed to get frequency details."})
154 if (correlationAttributes.isEmpty()) {
155 JOptionPane.showConfirmDialog(showCommonalityMenuItem,
156 Bundle.DataContentViewerOtherCases_correlatedArtifacts_isEmpty(),
157 Bundle.DataContentViewerOtherCases_correlatedArtifacts_title(),
158 DEFAULT_OPTION, PLAIN_MESSAGE);
160 StringBuilder msg =
new StringBuilder();
166 msg.append(Bundle.DataContentViewerOtherCases_correlatedArtifacts_byType(percentage,
167 eamArtifact.getCorrelationType().getDisplayName(),
168 eamArtifact.getCorrelationValue()));
170 JOptionPane.showConfirmDialog(showCommonalityMenuItem,
172 Bundle.DataContentViewerOtherCases_correlatedArtifacts_title(),
173 DEFAULT_OPTION, PLAIN_MESSAGE);
175 logger.log(Level.SEVERE,
"Error getting commonality details.", ex);
176 JOptionPane.showConfirmDialog(showCommonalityMenuItem,
177 Bundle.DataContentViewerOtherCases_correlatedArtifacts_failed(),
178 Bundle.DataContentViewerOtherCases_correlatedArtifacts_title(),
179 DEFAULT_OPTION, ERROR_MESSAGE);
184 @Messages({
"DataContentViewerOtherCases.caseDetailsDialog.notSelected=No Row Selected",
185 "DataContentViewerOtherCases.caseDetailsDialog.noDetails=No details for this case.",
186 "DataContentViewerOtherCases.caseDetailsDialog.noDetailsReference=No case details for Global reference properties.",
187 "DataContentViewerOtherCases.caseDetailsDialog.noCaseNameError=Error",
188 "DataContentViewerOtherCases.noOpenCase.errMsg=No open case available."})
194 JOptionPane.showConfirmDialog(showCaseDetailsMenuItem,
195 Bundle.DataContentViewerOtherCases_noOpenCase_errMsg(),
196 Bundle.DataContentViewerOtherCases_noOpenCase_errMsg(),
197 DEFAULT_OPTION, PLAIN_MESSAGE);
200 String caseDisplayName = Bundle.DataContentViewerOtherCases_caseDetailsDialog_noCaseNameError();
202 if (-1 != selectedRowViewIdx) {
204 int selectedRowModelIdx = otherCasesTable.convertRowIndexToModel(selectedRowViewIdx);
207 if (eamCasePartial == null) {
208 JOptionPane.showConfirmDialog(showCaseDetailsMenuItem,
209 Bundle.DataContentViewerOtherCases_caseDetailsDialog_noDetailsReference(),
211 DEFAULT_OPTION, PLAIN_MESSAGE);
217 if (eamCase == null) {
218 JOptionPane.showConfirmDialog(showCaseDetailsMenuItem,
219 Bundle.DataContentViewerOtherCases_caseDetailsDialog_noDetails(),
221 DEFAULT_OPTION, PLAIN_MESSAGE);
226 JOptionPane.showConfirmDialog(showCaseDetailsMenuItem,
229 DEFAULT_OPTION, PLAIN_MESSAGE);
231 JOptionPane.showConfirmDialog(showCaseDetailsMenuItem,
232 Bundle.DataContentViewerOtherCases_caseDetailsDialog_notSelected(),
234 DEFAULT_OPTION, PLAIN_MESSAGE);
237 JOptionPane.showConfirmDialog(showCaseDetailsMenuItem,
238 Bundle.DataContentViewerOtherCases_caseDetailsDialog_noDetails(),
240 DEFAULT_OPTION, PLAIN_MESSAGE);
245 if (0 != otherCasesTable.getSelectedRowCount()) {
246 Calendar now = Calendar.getInstance();
247 String fileName = String.format(
"%1$tY%1$tm%1$te%1$tI%1$tM%1$tS_other_data_sources.csv", now);
249 CSVFileChooser.setSelectedFile(
new File(fileName));
250 CSVFileChooser.setFileFilter(
new FileNameExtensionFilter(
"csv file",
"csv"));
252 int returnVal = CSVFileChooser.showSaveDialog(otherCasesTable);
253 if (returnVal == JFileChooser.APPROVE_OPTION) {
255 File selectedFile = CSVFileChooser.getSelectedFile();
256 if (!selectedFile.getName().endsWith(
".csv")) {
257 selectedFile =
new File(selectedFile.toString() +
".csv");
260 writeSelectedRowsToFileAsCSV(selectedFile);
266 StringBuilder content;
267 int[] selectedRowViewIndices = otherCasesTable.getSelectedRows();
270 try (BufferedWriter writer = Files.newBufferedWriter(destFile.toPath())) {
273 content =
new StringBuilder(
"");
274 for (
int colIdx = 0; colIdx < colCount; colIdx++) {
275 content.append(
'"').append(tableModel.
getColumnName(colIdx)).append(
'"');
276 if (colIdx < (colCount - 1)) {
281 content.append(System.getProperty(
"line.separator"));
282 writer.write(content.toString());
285 for (
int rowViewIdx : selectedRowViewIndices) {
286 content =
new StringBuilder(
"");
287 for (
int colIdx = 0; colIdx < colCount; colIdx++) {
288 int rowModelIdx = otherCasesTable.convertRowIndexToModel(rowViewIdx);
289 content.append(
'"').append(tableModel.
getValueAt(rowModelIdx, colIdx)).append(
'"');
290 if (colIdx < (colCount - 1)) {
294 content.append(System.getProperty(
"line.separator"));
295 writer.write(content.toString());
298 }
catch (IOException ex) {
299 logger.log(Level.SEVERE,
"Error writing selected rows to CSV.", ex);
309 correlationAttributes.clear();
314 return Bundle.DataContentViewerOtherCases_title();
319 return Bundle.DataContentViewerOtherCases_toolTip();
350 BlackboardArtifactTag nodeBbArtifactTag = node.getLookup().lookup(BlackboardArtifactTag.class);
351 BlackboardArtifact nodeBbArtifact = node.getLookup().lookup(BlackboardArtifact.class);
353 if (nodeBbArtifactTag != null) {
354 return nodeBbArtifactTag.getArtifact();
355 }
else if (nodeBbArtifact != null) {
356 return nodeBbArtifact;
370 BlackboardArtifactTag nodeBbArtifactTag = node.getLookup().lookup(BlackboardArtifactTag.class);
371 ContentTag nodeContentTag = node.getLookup().lookup(ContentTag.class);
372 BlackboardArtifact nodeBbArtifact = node.getLookup().lookup(BlackboardArtifact.class);
373 AbstractFile nodeAbstractFile = node.getLookup().lookup(AbstractFile.class);
375 if (nodeBbArtifactTag != null) {
376 Content content = nodeBbArtifactTag.getContent();
377 if (content instanceof AbstractFile) {
378 return (AbstractFile) content;
380 }
else if (nodeContentTag != null) {
381 Content content = nodeContentTag.getContent();
382 if (content instanceof AbstractFile) {
383 return (AbstractFile) content;
385 }
else if (nodeBbArtifact != null) {
388 content = nodeBbArtifact.getSleuthkitCase().getContentById(nodeBbArtifact.getObjectID());
389 }
catch (TskCoreException ex) {
390 logger.log(Level.SEVERE,
"Error retrieving blackboard artifact", ex);
394 if (content instanceof AbstractFile) {
395 return (AbstractFile) content;
397 }
else if (nodeAbstractFile != null) {
398 return nodeAbstractFile;
413 Collection<CorrelationAttribute> ret =
new ArrayList<>();
416 BlackboardArtifact bbArtifact = getBlackboardArtifactFromNode(node);
426 String md5 = this.file.getMd5Hash();
427 if (md5 != null && !md5.isEmpty() && null != artifactTypes && !artifactTypes.isEmpty()) {
436 logger.log(Level.SEVERE,
"Error connecting to DB", ex);
442 if (this.file != null) {
443 String md5 = this.file.getMd5Hash();
444 if (md5 != null && !md5.isEmpty()) {
449 logger.log(Level.SEVERE,
"Error connecting to DB", ex);
471 String caseUUID = openCase.
getName();
472 String filePath = (file.getParentPath() + file.getName()).toLowerCase();
473 HashMap<UniquePathKey, CorrelationAttributeInstance> artifactInstances =
new HashMap<>();
478 .filter(artifactInstance -> !artifactInstance.getFilePath().equals(filePath)
479 || !artifactInstance.getCorrelationCase().getCaseUUID().equals(caseUUID)
480 || !artifactInstance.getCorrelationDataSource().getName().equals(dataSourceName)
481 || !artifactInstance.getCorrelationDataSource().getDeviceID().equals(deviceId))
482 .collect(Collectors.toMap(correlationAttr ->
new UniquePathKey(correlationAttr.getCorrelationDataSource().getDeviceID(), correlationAttr.getFilePath()),
483 correlationAttr -> correlationAttr)));
487 List<AbstractFile> caseDbFiles = addCaseDbMatches(corAttr, openCase);
488 for (AbstractFile caseDbFile : caseDbFiles) {
489 addOrUpdateAttributeInstance(openCase, artifactInstances, caseDbFile);
493 return artifactInstances;
495 logger.log(Level.SEVERE,
"Error getting artifact instances from database.", ex);
497 logger.log(Level.SEVERE,
"Exception while getting open case.", ex);
498 }
catch (TskCoreException ex) {
501 logger.log(Level.SEVERE,
"Exception while querying open case.", ex);
504 return new HashMap<>(0);
508 String md5 = corAttr.getCorrelationValue();
510 SleuthkitCase tsk = openCase.getSleuthkitCase();
511 List<AbstractFile> matches = tsk.findAllFilesWhere(String.format(
"md5 = '%s'",
new Object[]{md5}));
513 List<AbstractFile> caseDbArtifactInstances =
new ArrayList<>();
514 for (AbstractFile fileMatch : matches) {
515 if (this.file.equals(fileMatch)) {
518 caseDbArtifactInstances.add(fileMatch);
520 return caseDbArtifactInstances;
537 TskData.FileKnown localKnown = newFile.getKnown();
539 if (localKnown != TskData.FileKnown.BAD) {
540 List<ContentTag> fileMatchTags = autopsyCase.getServices().getTagsManager().getContentTagsByContent(newFile);
541 for (ContentTag tag : fileMatchTags) {
542 TskData.FileKnown tagKnownStatus = tag.getName().getKnownStatus();
543 if (tagKnownStatus.equals(TskData.FileKnown.BAD)) {
544 localKnown = TskData.FileKnown.BAD;
551 String filePath = newFile.getParentPath() + newFile.getName();
554 deviceId = autopsyCase.getSleuthkitCase().getDataSource(newFile.getDataSource().getId()).getDeviceId();
555 }
catch (TskDataException | TskCoreException ex) {
556 logger.log(Level.WARNING,
"Error getting data source info: {0}", ex);
559 UniquePathKey uniquePathKey =
new UniquePathKey(deviceId, filePath);
562 if (artifactInstances.containsKey(uniquePathKey)) {
563 if (localKnown == TskData.FileKnown.BAD) {
576 artifactInstances.put(uniquePathKey, caseDbInstance);
582 this.file = this.getAbstractFileFromNode(node);
588 return this.file != null
589 && this.file.getSize() > 0
590 && !getCorrelationAttributesFromNode(node).isEmpty();
592 return this.file != null
593 && this.file.getSize() > 0;
598 @Messages({
"DataContentViewerOtherCases.table.nodbconnection=Cannot connect to central repository database."})
606 this.file = this.getAbstractFileFromNode(node);
616 @Messages({
"DataContentViewerOtherCases.table.isempty=There are no associated artifacts or files from other occurrences to display.",
617 "DataContentViewerOtherCases.table.noArtifacts=Correlation cannot be performed on the selected file."})
619 String dataSourceName =
"";
620 String deviceId =
"";
622 if (this.file != null) {
623 Content dataSource = this.file.getDataSource();
624 dataSourceName = dataSource.getName();
627 }
catch (TskException | NoCurrentCaseException ex) {
633 correlationAttributes.addAll(getCorrelationAttributesFromNode(node));
635 Map<UniquePathKey, CorrelationAttributeInstance> corAttrInstances =
new HashMap<>(0);
638 corAttrInstances.putAll(getCorrelatedInstances(corAttr, dataSourceName, deviceId));
640 corAttrInstances.values().forEach((corAttrInstance) -> {
643 corAttr.getCorrelationType(),
644 corAttr.getCorrelationValue()
649 logger.log(Level.SEVERE,
"Error creating correlation attribute", ex);
654 if (correlationAttributes.isEmpty()) {
656 displayMessageOnTableStatusPanel(Bundle.DataContentViewerOtherCases_table_noArtifacts());
658 displayMessageOnTableStatusPanel(Bundle.DataContentViewerOtherCases_table_isempty());
660 clearMessageOnTableStatusPanel();
667 TableColumn column = otherCasesTable.getColumnModel().getColumn(idx);
670 column.setPreferredWidth(colWidth);
676 tableStatusPanelLabel.setText(message);
677 tableStatusPanelLabel.setVisible(
true);
681 tableStatusPanelLabel.setVisible(
false);
689 @SuppressWarnings(
"unchecked")
691 private
void initComponents() {
693 rightClickPopupMenu =
new javax.swing.JPopupMenu();
694 selectAllMenuItem =
new javax.swing.JMenuItem();
695 exportToCSVMenuItem =
new javax.swing.JMenuItem();
696 showCaseDetailsMenuItem =
new javax.swing.JMenuItem();
697 showCommonalityMenuItem =
new javax.swing.JMenuItem();
698 addCommentMenuItem =
new javax.swing.JMenuItem();
699 CSVFileChooser =
new javax.swing.JFileChooser();
700 otherCasesPanel =
new javax.swing.JPanel();
701 tableContainerPanel =
new javax.swing.JPanel();
702 tableScrollPane =
new javax.swing.JScrollPane();
703 otherCasesTable =
new javax.swing.JTable();
704 tableStatusPanel =
new javax.swing.JPanel();
705 tableStatusPanelLabel =
new javax.swing.JLabel();
707 rightClickPopupMenu.addPopupMenuListener(
new javax.swing.event.PopupMenuListener() {
708 public void popupMenuCanceled(javax.swing.event.PopupMenuEvent evt) {
710 public void popupMenuWillBecomeInvisible(javax.swing.event.PopupMenuEvent evt) {
712 public void popupMenuWillBecomeVisible(javax.swing.event.PopupMenuEvent evt) {
713 rightClickPopupMenuPopupMenuWillBecomeVisible(evt);
717 org.openide.awt.Mnemonics.setLocalizedText(selectAllMenuItem,
org.openide.util.NbBundle.getMessage(
DataContentViewerOtherCases.class,
"DataContentViewerOtherCases.selectAllMenuItem.text"));
718 rightClickPopupMenu.add(selectAllMenuItem);
720 org.openide.awt.Mnemonics.setLocalizedText(exportToCSVMenuItem,
org.openide.util.NbBundle.getMessage(
DataContentViewerOtherCases.class,
"DataContentViewerOtherCases.exportToCSVMenuItem.text"));
721 rightClickPopupMenu.add(exportToCSVMenuItem);
723 org.openide.awt.Mnemonics.setLocalizedText(showCaseDetailsMenuItem,
org.openide.util.NbBundle.getMessage(
DataContentViewerOtherCases.class,
"DataContentViewerOtherCases.showCaseDetailsMenuItem.text"));
724 rightClickPopupMenu.add(showCaseDetailsMenuItem);
726 org.openide.awt.Mnemonics.setLocalizedText(showCommonalityMenuItem,
org.openide.util.NbBundle.getMessage(
DataContentViewerOtherCases.class,
"DataContentViewerOtherCases.showCommonalityMenuItem.text"));
727 rightClickPopupMenu.add(showCommonalityMenuItem);
729 org.openide.awt.Mnemonics.setLocalizedText(addCommentMenuItem,
org.openide.util.NbBundle.getMessage(
DataContentViewerOtherCases.class,
"DataContentViewerOtherCases.addCommentMenuItem.text"));
730 rightClickPopupMenu.add(addCommentMenuItem);
732 setMinimumSize(
new java.awt.Dimension(1500, 10));
734 setPreferredSize(
new java.awt.Dimension(1500, 44));
736 otherCasesPanel.setPreferredSize(
new java.awt.Dimension(1500, 144));
738 tableContainerPanel.setPreferredSize(
new java.awt.Dimension(1500, 63));
740 tableScrollPane.setPreferredSize(
new java.awt.Dimension(1500, 30));
742 otherCasesTable.setAutoCreateRowSorter(
true);
743 otherCasesTable.setModel(tableModel);
744 otherCasesTable.setToolTipText(
org.openide.util.NbBundle.getMessage(
DataContentViewerOtherCases.class,
"DataContentViewerOtherCases.table.toolTip.text"));
745 otherCasesTable.setComponentPopupMenu(rightClickPopupMenu);
746 otherCasesTable.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_INTERVAL_SELECTION);
747 tableScrollPane.setViewportView(otherCasesTable);
749 tableStatusPanel.setPreferredSize(
new java.awt.Dimension(1500, 16));
751 tableStatusPanelLabel.setForeground(
new java.awt.Color(255, 0, 51));
753 javax.swing.GroupLayout tableStatusPanelLayout =
new javax.swing.GroupLayout(tableStatusPanel);
754 tableStatusPanel.setLayout(tableStatusPanelLayout);
755 tableStatusPanelLayout.setHorizontalGroup(
756 tableStatusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
757 .addGap(0, 0, Short.MAX_VALUE)
758 .addGroup(tableStatusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
759 .addGroup(tableStatusPanelLayout.createSequentialGroup()
761 .addComponent(tableStatusPanelLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 780, Short.MAX_VALUE)
764 tableStatusPanelLayout.setVerticalGroup(
765 tableStatusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
766 .addGap(0, 16, Short.MAX_VALUE)
767 .addGroup(tableStatusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
768 .addGroup(tableStatusPanelLayout.createSequentialGroup()
769 .addComponent(tableStatusPanelLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
770 .addGap(0, 0, Short.MAX_VALUE)))
773 javax.swing.GroupLayout tableContainerPanelLayout =
new javax.swing.GroupLayout(tableContainerPanel);
774 tableContainerPanel.setLayout(tableContainerPanelLayout);
775 tableContainerPanelLayout.setHorizontalGroup(
776 tableContainerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
777 .addComponent(tableScrollPane, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
778 .addComponent(tableStatusPanel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
780 tableContainerPanelLayout.setVerticalGroup(
781 tableContainerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
782 .addGroup(tableContainerPanelLayout.createSequentialGroup()
783 .addComponent(tableScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
784 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
785 .addComponent(tableStatusPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
789 javax.swing.GroupLayout otherCasesPanelLayout =
new javax.swing.GroupLayout(otherCasesPanel);
790 otherCasesPanel.setLayout(otherCasesPanelLayout);
791 otherCasesPanelLayout.setHorizontalGroup(
792 otherCasesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
793 .addGap(0, 1500, Short.MAX_VALUE)
794 .addGroup(otherCasesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
795 .addComponent(tableContainerPanel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
797 otherCasesPanelLayout.setVerticalGroup(
798 otherCasesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
799 .addGap(0, 60, Short.MAX_VALUE)
800 .addGroup(otherCasesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
801 .addGroup(otherCasesPanelLayout.createSequentialGroup()
802 .addComponent(tableContainerPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 52, Short.MAX_VALUE)
806 javax.swing.GroupLayout layout =
new javax.swing.GroupLayout(
this);
807 this.setLayout(layout);
808 layout.setHorizontalGroup(
809 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
810 .addComponent(otherCasesPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
812 layout.setVerticalGroup(
813 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
814 .addComponent(otherCasesPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 52, Short.MAX_VALUE)
819 boolean addCommentMenuItemVisible =
false;
822 int rowIndex = otherCasesTable.getSelectedRow();
824 if (selectedAttribute.
getInstances().get(0).isDatabaseInstance()
826 addCommentMenuItemVisible =
true;
830 addCommentMenuItem.setVisible(addCommentMenuItemVisible);
853 static final class UniquePathKey {
855 private final String dataSourceID;
856 private final String filePath;
858 UniquePathKey(String theDataSource, String theFilePath) {
860 dataSourceID = theDataSource;
861 filePath = theFilePath.toLowerCase();
868 String getDataSourceID() {
876 String getFilePath() {
881 public boolean equals(Object other) {
882 if (other instanceof UniquePathKey) {
883 return ((UniquePathKey) other).getDataSourceID().equals(dataSourceID) && ((UniquePathKey) other).getFilePath().equals(filePath);
889 public int hashCode() {
893 return Objects.hash(dataSourceID, filePath);
int getFrequencyPercentage(CorrelationAttribute corAttr)
String getCorrelationValue()
void writeSelectedRowsToFileAsCSV(File destFile)
void rightClickPopupMenuPopupMenuWillBecomeVisible(javax.swing.event.PopupMenuEvent evt)
final DataContentViewerOtherCasesTableModel tableModel
javax.swing.JScrollPane tableScrollPane
int isPreferred(Node node)
javax.swing.JMenuItem selectAllMenuItem
Type getCorrelationType()
static final int FILES_TYPE_ID
javax.swing.JMenuItem showCommonalityMenuItem
final Collection< CorrelationAttribute > correlationAttributes
static CorrelationDataSource fromTSKDataSource(CorrelationCase correlationCase, Content dataSource)
static boolean useCentralRepo()
javax.swing.JPanel tableContainerPanel
AbstractFile getAbstractFileFromNode(Node node)
javax.swing.JLabel tableStatusPanelLabel
void addOrUpdateAttributeInstance(final Case autopsyCase, Map< UniquePathKey, CorrelationAttributeInstance > artifactInstances, AbstractFile newFile)
void addInstance(CorrelationAttributeInstance artifactInstance)
List< CorrelationAttributeInstance > getArtifactInstancesByTypeValue(CorrelationAttribute.Type aType, String value)
javax.swing.JPanel otherCasesPanel
void populateTable(Node node)
javax.swing.JPopupMenu rightClickPopupMenu
BlackboardArtifact getBlackboardArtifactFromNode(Node node)
List< AbstractFile > addCaseDbMatches(CorrelationAttribute corAttr, Case openCase)
static EamDb getInstance()
boolean isSupported(Node node)
void setKnownStatus(TskData.FileKnown knownStatus)
Collection< CorrelationAttribute > getCorrelationAttributesFromNode(Node node)
int getColumnPreferredWidth(int colIdx)
String getCaseDetailsOptionsPaneDialog()
javax.swing.JTable otherCasesTable
void showCaseDetails(int selectedRowViewIdx)
String getColumnName(int colIdx)
javax.swing.JMenuItem exportToCSVMenuItem
List< CorrelationAttributeInstance > getInstances()
static boolean isEnabled()
SleuthkitCase getSleuthkitCase()
void showCommonalityDetails()
javax.swing.JMenuItem addCommentMenuItem
Object getValueAt(int rowIdx, int colIdx)
DataContentViewerOtherCases()
Object getRow(int rowIdx)
void addEamArtifact(CorrelationAttribute eamArtifact)
javax.swing.JPanel tableStatusPanel
CorrelationCase getCase(Case autopsyCase)
javax.swing.JFileChooser CSVFileChooser
void clearMessageOnTableStatusPanel()
static Case getCurrentCase()
synchronized static Logger getLogger(String name)
static List< CorrelationAttribute.Type > getDefaultCorrelationTypes()
static Case getCurrentCaseThrows()
void displayMessageOnTableStatusPanel(String message)
String getExportDirectory()
DataContentViewer createInstance()
List< CorrelationAttribute.Type > getDefinedCorrelationTypes()
void customizeComponents()
Map< UniquePathKey, CorrelationAttributeInstance > getCorrelatedInstances(CorrelationAttribute corAttr, String dataSourceName, String deviceId)
static List< CorrelationAttribute > getCorrelationAttributeFromBlackboardArtifact(BlackboardArtifact bbArtifact, boolean addInstanceDetails, boolean checkEnabled)
javax.swing.JMenuItem showCaseDetailsMenuItem