19 package org.sleuthkit.autopsy.directorytree;
 
   21 import java.awt.Cursor;
 
   22 import java.awt.EventQueue;
 
   23 import java.beans.PropertyChangeEvent;
 
   24 import java.beans.PropertyChangeListener;
 
   25 import java.beans.PropertyVetoException;
 
   26 import java.io.IOException;
 
   27 import java.util.ArrayList;
 
   28 import java.util.Arrays;
 
   29 import java.util.HashSet;
 
   30 import java.util.LinkedList;
 
   31 import java.util.List;
 
   33 import java.util.logging.Level;
 
   34 import java.util.prefs.PreferenceChangeEvent;
 
   35 import java.util.prefs.PreferenceChangeListener;
 
   36 import javax.swing.Action;
 
   37 import javax.swing.SwingUtilities;
 
   38 import javax.swing.tree.TreeSelectionModel;
 
   39 import org.apache.commons.lang3.StringUtils;
 
   40 import org.openide.explorer.ExplorerManager;
 
   41 import org.openide.explorer.ExplorerUtils;
 
   42 import org.openide.explorer.view.BeanTreeView;
 
   43 import org.openide.explorer.view.TreeView;
 
   44 import org.openide.nodes.AbstractNode;
 
   45 import org.openide.nodes.Children;
 
   46 import org.openide.nodes.Node;
 
   47 import org.openide.nodes.NodeNotFoundException;
 
   48 import org.openide.nodes.NodeOp;
 
   49 import org.openide.util.NbBundle;
 
   50 import org.openide.util.NbBundle.Messages;
 
   51 import org.openide.windows.TopComponent;
 
   52 import org.openide.windows.WindowManager;
 
   97     "DirectoryTreeTopComponent.resultsView.title=Listing" 
  101     private final transient ExplorerManager em = 
new ExplorerManager();
 
  106     private static final String PREFERRED_ID = 
"DirectoryTreeTopComponent"; 
 
  117         ((BeanTreeView) jScrollPane1).setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
 
  119         putClientProperty(TopComponent.PROP_CLOSING_DISABLED, Boolean.TRUE);
 
  123         subscribeToChangeEvents();
 
  124         associateLookup(ExplorerUtils.createLookup(em, getActionMap()));
 
  127         this.backList = 
new LinkedList<>();
 
  128         this.forwardList = 
new LinkedList<>();
 
  129         backButton.setEnabled(
false);
 
  130         forwardButton.setEnabled(
false);
 
  139             public void preferenceChange(PreferenceChangeEvent evt) {
 
  140                 switch (evt.getKey()) {
 
  143                         refreshContentTreeSafe();
 
  153         this.em.addPropertyChangeListener(
this);
 
  159         this.dataResult.requestActive();
 
  163         this.dataResult.
open();
 
  167         return this.dataResult;
 
  178         jScrollPane1 = 
new BeanTreeView();
 
  179         backButton = 
new javax.swing.JButton();
 
  180         forwardButton = 
new javax.swing.JButton();
 
  181         showRejectedCheckBox = 
new javax.swing.JCheckBox();
 
  183         jScrollPane1.setBorder(null);
 
  185         backButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/directorytree/btn_step_back.png"))); 
 
  186         org.openide.awt.Mnemonics.setLocalizedText(backButton, 
org.openide.util.NbBundle.getMessage(
DirectoryTreeTopComponent.class, 
"DirectoryTreeTopComponent.backButton.text")); 
 
  187         backButton.setBorderPainted(
false);
 
  188         backButton.setContentAreaFilled(
false);
 
  189         backButton.setDisabledIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/directorytree/btn_step_back_disabled.png"))); 
 
  190         backButton.setMargin(
new java.awt.Insets(2, 0, 2, 0));
 
  191         backButton.setMaximumSize(
new java.awt.Dimension(55, 100));
 
  192         backButton.setMinimumSize(
new java.awt.Dimension(5, 5));
 
  193         backButton.setPreferredSize(
new java.awt.Dimension(23, 23));
 
  194         backButton.setRolloverIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/directorytree/btn_step_back_hover.png"))); 
 
  195         backButton.addActionListener(
new java.awt.event.ActionListener() {
 
  196             public void actionPerformed(java.awt.event.ActionEvent evt) {
 
  197                 backButtonActionPerformed(evt);
 
  201         forwardButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/directorytree/btn_step_forward.png"))); 
 
  202         org.openide.awt.Mnemonics.setLocalizedText(forwardButton, 
org.openide.util.NbBundle.getMessage(
DirectoryTreeTopComponent.class, 
"DirectoryTreeTopComponent.forwardButton.text")); 
 
  203         forwardButton.setBorderPainted(
false);
 
  204         forwardButton.setContentAreaFilled(
false);
 
  205         forwardButton.setDisabledIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/directorytree/btn_step_forward_disabled.png"))); 
 
  206         forwardButton.setMargin(
new java.awt.Insets(2, 0, 2, 0));
 
  207         forwardButton.setMaximumSize(
new java.awt.Dimension(55, 100));
 
  208         forwardButton.setMinimumSize(
new java.awt.Dimension(5, 5));
 
  209         forwardButton.setPreferredSize(
new java.awt.Dimension(23, 23));
 
  210         forwardButton.setRolloverIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/directorytree/btn_step_forward_hover.png"))); 
 
  211         forwardButton.addActionListener(
new java.awt.event.ActionListener() {
 
  212             public void actionPerformed(java.awt.event.ActionEvent evt) {
 
  213                 forwardButtonActionPerformed(evt);
 
  217         org.openide.awt.Mnemonics.setLocalizedText(showRejectedCheckBox, 
org.openide.util.NbBundle.getMessage(
DirectoryTreeTopComponent.class, 
"DirectoryTreeTopComponent.showRejectedCheckBox.text")); 
 
  219         javax.swing.GroupLayout layout = 
new javax.swing.GroupLayout(
this);
 
  220         this.setLayout(layout);
 
  221         layout.setHorizontalGroup(
 
  222             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 
  223             .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 262, Short.MAX_VALUE)
 
  224             .addGroup(layout.createSequentialGroup()
 
  226                 .addComponent(backButton, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
 
  228                 .addComponent(forwardButton, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
 
  229                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 46, Short.MAX_VALUE)
 
  230                 .addComponent(showRejectedCheckBox)
 
  233         layout.setVerticalGroup(
 
  234             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 
  235             .addGroup(layout.createSequentialGroup()
 
  237                 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
 
  238                     .addComponent(forwardButton, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
 
  239                     .addComponent(backButton, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
 
  240                     .addComponent(showRejectedCheckBox))
 
  241                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 
  242                 .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 854, Short.MAX_VALUE)
 
  249         this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
 
  252         String[] currentNodePath = backList.pollLast();
 
  253         forwardList.addLast(currentNodePath);
 
  254         forwardButton.setEnabled(
true);
 
  261         String[] newCurrentNodePath = backList.peekLast();
 
  264         if (backList.size() > 1) {
 
  265             backButton.setEnabled(
true);
 
  267             backButton.setEnabled(
false);
 
  271         setSelectedNode(newCurrentNodePath, null);
 
  273         this.setCursor(null);
 
  278         this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
 
  280         String[] newCurrentNodePath = forwardList.pollLast();
 
  281         if (!forwardList.isEmpty()) {
 
  282             forwardButton.setEnabled(
true);
 
  284             forwardButton.setEnabled(
false);
 
  287         backList.addLast(newCurrentNodePath);
 
  288         backButton.setEnabled(
true);
 
  291         setSelectedNode(newCurrentNodePath, null);
 
  293         this.setCursor(null);
 
  312         if (instance == null) {
 
  325         WindowManager winManager = WindowManager.
getDefault();
 
  326         TopComponent win = winManager.findTopComponent(PREFERRED_ID);
 
  329                     "Cannot find " + PREFERRED_ID + 
" component. It will not be located properly in the window system."); 
 
  333             return (DirectoryTreeTopComponent) win;
 
  336                 "There seem to be multiple components with the '" + PREFERRED_ID 
 
  337                 + 
"' ID. That is a potential source of errors and unexpected behavior."); 
 
  349         return TopComponent.PERSISTENCE_NEVER;
 
  362         this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
 
  364             Case currentCase = null;
 
  367             } 
catch (IllegalStateException ex) {
 
  374             if (null == currentCase || currentCase.
hasData() == 
false) {
 
  375                 ((TreeView) this.jScrollPane1).setRootVisible(
false); 
 
  378                 List<Object> items = 
new ArrayList<>();
 
  381                 items.add(
new Views(tskCase));
 
  382                 items.add(
new Results(tskCase));
 
  383                 items.add(
new Tags());
 
  387                 Node root = 
new AbstractNode(contentChildren) {
 
  393                     public Action[] getActions(
boolean popup) {
 
  394                         return new Action[]{};
 
  400                     public Node.Handle getHandle() {
 
  401                         return new Node.Handle() {
 
  403                             public Node getNode() 
throws IOException {
 
  404                                 return em.getRootContext();
 
  410                 root = 
new DirectoryTreeFilterNode(root, 
true);
 
  412                 em.setRootContext(root);
 
  413                 em.getRootContext().setName(currentCase.
getName());
 
  414                 em.getRootContext().setDisplayName(currentCase.
getName());
 
  415                 ((TreeView) this.jScrollPane1).setRootVisible(
false); 
 
  420                 Children childNodes = em.getRootContext().getChildren();
 
  421                 TreeView tree = getTree();
 
  424                 tree.expandNode(results);
 
  426                 Children resultsChilds = results.getChildren();
 
  427                 for (Node n : resultsChilds.getNodes()) {
 
  433                 showRejectedCheckBox.setSelected(
false);
 
  436                 Children viewsChilds = views.getChildren();
 
  437                 for (Node n : viewsChilds.getNodes()) {
 
  441                 tree.collapseNode(views);
 
  444                 if (!dataResult.isOpened()) {
 
  452                 if (childNodes.getNodesCount() > 0) {
 
  454                         em.setSelectedNodes(
new Node[]{childNodes.getNodeAt(0)});
 
  455                     } 
catch (PropertyVetoException ex) {
 
  456                         LOGGER.log(Level.SEVERE, 
"Error setting default selected node.", ex); 
 
  462             this.setCursor(null);
 
  475         contentChildren = null;
 
  478     void writeProperties(java.util.Properties p) {
 
  481         p.setProperty(
"version", 
"1.0");
 
  485     Object readProperties(java.util.Properties p) {
 
  486         if (instance == null) {
 
  494         String version = p.getProperty(
"version");
 
  535         return new Action[]{};
 
  546         Node[] selectedNodes = this.getExplorerManager().getSelectedNodes();
 
  547         if (selectedNodes.length > 0) {
 
  548             result = selectedNodes[0];
 
  562             String changed = evt.getPropertyName();
 
  572                 if (evt.getOldValue() != null && evt.getNewValue() == null) {
 
  574                     SwingUtilities.invokeLater(() -> {
 
  575                         Node emptyNode = 
new AbstractNode(Children.LEAF);
 
  576                         em.setRootContext(emptyNode);
 
  578                 } 
else if (evt.getNewValue() != null) {
 
  580                     Case newCase = (
Case) evt.getNewValue();
 
  581                     final String newCaseName = newCase.
getName();
 
  582                     SwingUtilities.invokeLater(() -> {
 
  583                         em.getRootContext().setName(newCaseName);
 
  584                         em.getRootContext().setDisplayName(newCaseName);
 
  608                         SwingUtilities.invokeLater(() -> {
 
  612                 } 
catch (IllegalStateException | TskCoreException notUsed) {
 
  618             else if (changed.equals(ExplorerManager.PROP_SELECTED_NODES)) {
 
  619                 respondSelection((Node[]) evt.getOldValue(), (Node[]) evt.getNewValue());
 
  635     @NbBundle.Messages(
"DirectoryTreeTopComponent.emptyMimeNode.text=Data not available. Run file type identification module.")
 
  646         EventQueue.invokeLater(() -> {
 
  651                 if (treeNode != null) {
 
  652                     Node originNode = ((DirectoryTreeFilterNode) treeNode).getOriginal();
 
  659                         EmptyNode emptyNode = 
new EmptyNode(Bundle.DirectoryTreeTopComponent_emptyMimeNode_text());
 
  666                     String displayName = 
"";
 
  667                     Content content = originNode.getLookup().lookup(Content.class);
 
  668                     if (content != null) {
 
  670                             displayName = content.getUniquePath();
 
  671                         } 
catch (TskCoreException ex) {
 
  672                             LOGGER.log(Level.SEVERE, 
"Exception while calling Content.getUniquePath() for node: {0}", originNode); 
 
  674                     } 
else if (originNode.getLookup().lookup(String.class) != null) {
 
  675                         displayName = originNode.getLookup().lookup(String.class);
 
  677                     dataResult.
setPath(displayName);
 
  680                 if (oldNodes != null && newNodes != null
 
  681                         && (oldNodes.length == newNodes.length)) {
 
  682                     boolean sameNodes = 
true;
 
  683                     for (
int i = 0; i < oldNodes.length; i++) {
 
  684                         sameNodes = sameNodes && oldNodes[i].getName().equals(newNodes[i].getName());
 
  687                         dataResult.requestActive();
 
  696         updateHistory(em.getSelectedNodes());
 
  700         if (selectedNodes.length == 0) {
 
  704         Node selectedNode = selectedNodes[0];
 
  705         String selectedNodeName = selectedNode.getName();
 
  713         String[] currentLast = backList.peekLast();
 
  714         String lastNodeName = null;
 
  715         if (currentLast != null) {
 
  716             lastNodeName = currentLast[currentLast.length - 1];
 
  719         if (currentLast == null || !selectedNodeName.equals(lastNodeName)) {
 
  721             final String[] selectedPath = NodeOp.createPath(selectedNode, em.getRootContext());
 
  722             backList.addLast(selectedPath); 
 
  723             if (backList.size() > 1) {
 
  724                 backButton.setEnabled(
true);
 
  726                 backButton.setEnabled(
false);
 
  730             forwardButton.setEnabled(
false); 
 
  742         backButton.setEnabled(
false);
 
  743         forwardButton.setEnabled(
false);
 
  752         return (BeanTreeView) this.jScrollPane1;
 
  759         SwingUtilities.invokeLater(
new Runnable() {
 
  762                 refreshDataSourceTree();
 
  771         Node selectedNode = getSelectedNode();
 
  772         final String[] selectedPath = NodeOp.createPath(selectedNode, em.getRootContext());
 
  773         Children rootChildren = em.getRootContext().getChildren();
 
  775         if (dataSourcesFilterNode == null) {
 
  776             LOGGER.log(Level.SEVERE, 
"Cannot find data sources filter node, won't refresh the content tree"); 
 
  779         Node dataSourcesNode = ((DirectoryTreeFilterNode) dataSourcesFilterNode).getOriginal();
 
  792     private void setSelectedNode(
final String[] previouslySelectedNodePath, 
final String rootNodeName) {
 
  793         if (previouslySelectedNodePath == null) {
 
  796         SwingUtilities.invokeLater(
new Runnable() {
 
  799                 if (previouslySelectedNodePath.length > 0 && (rootNodeName == null || previouslySelectedNodePath[0].equals(rootNodeName))) {
 
  800                     Node selectedNode = null;
 
  801                     ArrayList<String> selectedNodePath = 
new ArrayList<>(Arrays.asList(previouslySelectedNodePath));
 
  802                     while (null == selectedNode && !selectedNodePath.isEmpty()) {
 
  804                             selectedNode = NodeOp.findPath(em.getRootContext(), selectedNodePath.toArray(
new String[0]));
 
  805                         } 
catch (NodeNotFoundException ex) {
 
  807                             if (selectedNodePath.size() > 1) {
 
  808                                 selectedNodePath.remove(selectedNodePath.size() - 1);
 
  810                                 StringBuilder nodePath = 
new StringBuilder();
 
  811                                 for (
int i = 0; i < previouslySelectedNodePath.length; ++i) {
 
  812                                     nodePath.append(previouslySelectedNodePath[i]).append(
"/");
 
  814                                 LOGGER.log(Level.WARNING, 
"Failed to find any nodes to select on path " + nodePath.toString(), ex); 
 
  820                     if (null != selectedNode) {
 
  821                         if (rootNodeName != null) {
 
  827                             em.setExploredContextAndSelection(selectedNode, 
new Node[]{selectedNode});
 
  828                         } 
catch (PropertyVetoException ex) {
 
  829                             LOGGER.log(Level.WARNING, 
"Property veto from ExplorerManager setting selection to " + selectedNode.getName(), ex); 
 
  849         int typeID = art.getArtifactTypeID();
 
  850         String typeName = art.getArtifactTypeName();
 
  851         Children rootChilds = em.getRootContext().getChildren();
 
  852         Node treeNode = null;
 
  854         Children resultsChilds = resultsNode.getChildren();
 
  855         if (typeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_HASHSET_HIT.getTypeID()) {
 
  856             Node hashsetRootNode = resultsChilds.findChild(typeName);
 
  857             Children hashsetRootChilds = hashsetRootNode.getChildren();
 
  859                 String setName = null;
 
  860                 List<BlackboardAttribute> attributes = art.getAttributes();
 
  861                 for (BlackboardAttribute att : attributes) {
 
  862                     int typeId = att.getAttributeType().getTypeID();
 
  863                     if (typeId == BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SET_NAME.getTypeID()) {
 
  864                         setName = att.getValueString();
 
  867                 treeNode = hashsetRootChilds.findChild(setName);
 
  868             } 
catch (TskCoreException ex) {
 
  869                 LOGGER.log(Level.WARNING, 
"Error retrieving attributes", ex); 
 
  871         } 
else if (typeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_KEYWORD_HIT.getTypeID()) {
 
  872             Node keywordRootNode = resultsChilds.findChild(typeName);
 
  873             Children keywordRootChilds = keywordRootNode.getChildren();
 
  875                 String listName = null;
 
  876                 String keywordName = null;
 
  878                 List<BlackboardAttribute> attributes = art.getAttributes();
 
  879                 for (BlackboardAttribute att : attributes) {
 
  880                     int typeId = att.getAttributeType().getTypeID();
 
  881                     if (typeId == BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SET_NAME.getTypeID()) {
 
  882                         listName = att.getValueString();
 
  883                     } 
else if (typeId == BlackboardAttribute.ATTRIBUTE_TYPE.TSK_KEYWORD.getTypeID()) {
 
  884                         keywordName = att.getValueString();
 
  885                     } 
else if (typeId == BlackboardAttribute.ATTRIBUTE_TYPE.TSK_KEYWORD_REGEXP.getTypeID()) {
 
  886                         regex = att.getValueString();
 
  889                 if (listName == null) {
 
  891                         listName = NbBundle.getMessage(
KeywordHits.class, 
"KeywordHits.simpleLiteralSearch.text");
 
  893                         listName = NbBundle.getMessage(
KeywordHits.class, 
"KeywordHits.singleRegexSearch.text");
 
  896                 Node listNode = keywordRootChilds.findChild(listName);
 
  897                 if (listNode == null) {
 
  900                 Children listChildren = listNode.getChildren();
 
  901                 if (listChildren == null) {
 
  905                     Node regexNode = listChildren.findChild(regex);
 
  906                     if (regexNode == null) {
 
  909                     listChildren = regexNode.getChildren();
 
  910                     if (listChildren == null) {
 
  915                 treeNode = listChildren.findChild(keywordName);
 
  917             } 
catch (TskCoreException ex) {
 
  918                 LOGGER.log(Level.WARNING, 
"Error retrieving attributes", ex); 
 
  920         } 
else if (typeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_FILE_HIT.getTypeID()
 
  921                 || typeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_ARTIFACT_HIT.getTypeID()) {
 
  922             Node interestingItemsRootNode = resultsChilds.findChild(NbBundle
 
  923                     .getMessage(
InterestingHits.class, 
"InterestingHits.interestingItems.text"));
 
  924             Children interestingItemsRootChildren = interestingItemsRootNode.getChildren();
 
  926                 String setName = null;
 
  927                 List<BlackboardAttribute> attributes = art.getAttributes();
 
  928                 for (BlackboardAttribute att : attributes) {
 
  929                     int typeId = att.getAttributeType().getTypeID();
 
  930                     if (typeId == BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SET_NAME.getTypeID()) {
 
  931                         setName = att.getValueString();
 
  934                 Node setNode = interestingItemsRootChildren.findChild(setName);
 
  935                 if (setNode == null) {
 
  938                 Children interestingChildren = setNode.getChildren();
 
  939                 if (interestingChildren == null) {
 
  942                 treeNode = interestingChildren.findChild(art.getDisplayName());
 
  943             } 
catch (TskCoreException ex) {
 
  944                 LOGGER.log(Level.WARNING, 
"Error retrieving attributes", ex); 
 
  946         } 
else if (typeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_EMAIL_MSG.getTypeID()) {
 
  947             Node emailMsgRootNode = resultsChilds.findChild(typeName);
 
  948             Children emailMsgRootChilds = emailMsgRootNode.getChildren();
 
  949             Map<String, String> parsedPath = null;
 
  951                 List<BlackboardAttribute> attributes = art.getAttributes();
 
  952                 for (BlackboardAttribute att : attributes) {
 
  953                     int typeId = att.getAttributeType().getTypeID();
 
  954                     if (typeId == BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PATH.getTypeID()) {
 
  959                 if (parsedPath == null) {
 
  962                 Node defaultNode = emailMsgRootChilds.findChild(parsedPath.get(NbBundle.getMessage(
EmailExtracted.class, 
"EmailExtracted.defaultAcct.text")));
 
  963                 Children defaultChildren = defaultNode.getChildren();
 
  964                 treeNode = defaultChildren.findChild(parsedPath.get(NbBundle.getMessage(
EmailExtracted.class, 
"EmailExtracted.defaultFolder.text")));
 
  965             } 
catch (TskCoreException ex) {
 
  966                 LOGGER.log(Level.WARNING, 
"Error retrieving attributes", ex); 
 
  969         } 
else if (typeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_ACCOUNT.getTypeID()) {
 
  970             Node accountRootNode = resultsChilds.findChild(art.getDisplayName());
 
  971             Children accountRootChilds = accountRootNode.getChildren();
 
  972             List<BlackboardAttribute> attributes;
 
  973             String accountType = null;
 
  974             String ccNumberName = null;
 
  976                 attributes = art.getAttributes();
 
  977                 for (BlackboardAttribute att : attributes) {
 
  978                     int typeId = att.getAttributeType().getTypeID();
 
  979                     if (typeId == BlackboardAttribute.ATTRIBUTE_TYPE.TSK_ACCOUNT_TYPE.getTypeID()) {
 
  980                         accountType = att.getValueString();
 
  982                     if (typeId == BlackboardAttribute.ATTRIBUTE_TYPE.TSK_CARD_NUMBER.getTypeID()) {
 
  983                         ccNumberName = att.getValueString();
 
  986                 if (accountType == null) {
 
  990                 if (accountType.equals(Account.Type.CREDIT_CARD.name())) {
 
  991                     Node accountNode = accountRootChilds.findChild(Account.Type.CREDIT_CARD.getDisplayName());
 
  992                     if (accountNode == null) {
 
  995                     Children accountChildren = accountNode.getChildren();
 
  996                     if (accountChildren == null) {
 
  999                     Node binNode = accountChildren.findChild(NbBundle.getMessage(
Accounts.class, 
"Accounts.ByBINNode.name"));
 
 1000                     if (binNode == null) {
 
 1003                     Children binChildren = binNode.getChildren();
 
 1004                     if (ccNumberName == null) {
 
 1009                     String binName = StringUtils.rightPad(ccNumberName, 8, 
"0");
 
 1010                     binName = binName.substring(0, 8);
 
 1013                         bin = Integer.parseInt(binName);
 
 1014                     } 
catch (NumberFormatException ex) {
 
 1015                         LOGGER.log(Level.WARNING, 
"Unable to parseInt a BIN for node selection from string binName=" + binName, ex); 
 
 1019                     if (binInfo != null) {
 
 1020                         int startBin = ((
BINRange) binInfo).getBINstart();
 
 1021                         int endBin = ((
BINRange) binInfo).getBINend();
 
 1022                         if (startBin != endBin) {
 
 1023                             binName = Integer.toString(startBin) + 
"-" + Integer.toString(endBin).substring(5); 
 
 1026                     if (binName == null) {
 
 1029                     treeNode = binChildren.findChild(binName);
 
 1031                     treeNode = accountRootChilds.findChild(accountType);;
 
 1033             } 
catch (TskCoreException ex) {
 
 1034                 LOGGER.log(Level.WARNING, 
"Error retrieving attributes", ex); 
 
 1038             Children extractedChilds = extractedContent.getChildren();
 
 1039             if (extractedChilds == null) {
 
 1042             treeNode = extractedChilds.findChild(typeName);
 
 1045         if (treeNode == null) {
 
 1051         getTree().expandNode(treeNode);
 
 1053             em.setExploredContextAndSelection(treeNode, 
new Node[]{treeNode});
 
 1054         } 
catch (PropertyVetoException ex) {
 
 1055             LOGGER.log(Level.WARNING, 
"Property Veto: ", ex); 
 
 1063                 NbBundle.getMessage(
this.getClass(), 
"DirectoryTreeTopComponent.action.viewArtContent.text"),
 
 1072     void fireViewerComplete() {
 
 1076         } 
catch (Exception e) {
 
 1077             LOGGER.log(Level.SEVERE, 
"DirectoryTreeTopComponent listener threw exception", e); 
 
 1078             MessageNotifyUtil.Notify.show(NbBundle.getMessage(
this.getClass(), 
"DirectoryTreeTopComponent.moduleErr"),
 
 1079                     NbBundle.getMessage(
this.getClass(),
 
 1080                             "DirectoryTreeTopComponent.moduleErr.msg"),
 
 1081                     MessageNotifyUtil.MessageType.ERROR);
 
List< Content > getDataSources()
TopComponent getTopComponent()
void viewArtifact(final BlackboardArtifact art)
static final String HIDE_SLACK_FILES_IN_VIEWS_TREE
static final String HIDE_KNOWN_FILES_IN_VIEWS_TREE
javax.swing.JCheckBox showRejectedCheckBox
static synchronized IngestManager getInstance()
DataResultTopComponent getDirectoryListing()
final LinkedList< String[]> forwardList
void setDirectoryListingActive()
static boolean runningWithGUI
final transient ExplorerManager em
RootContentChildren contentChildren
void respondSelection(final Node[] oldNodes, final Node[] newNodes)
void setSelectedNode(final String[] previouslySelectedNodePath, final String rootNodeName)
boolean hasMenuOpenAction()
void propertyChange(PropertyChangeEvent evt)
static void openCoreWindows()
javax.swing.JScrollPane jScrollPane1
void updateHistory(Node[] selectedNodes)
final LinkedList< String[]> backList
static synchronized BankIdentificationNumber getBINInfo(int bin)
void openDirectoryListing()
void refreshContentTreeSafe()
void readPropertiesImpl(java.util.Properties p)
void backButtonActionPerformed(java.awt.event.ActionEvent evt)
static final String FINISHED_DISPLAY_EVT
static final String HIDE_KNOWN_FILES_IN_DATA_SRCS_TREE
DirectoryTreeTopComponent()
static synchronized DirectoryTreeTopComponent getDefault()
javax.swing.JButton forwardButton
void addIngestJobEventListener(final PropertyChangeListener listener)
void refreshContentKeys()
void viewArtifactContent(BlackboardArtifact art)
void refreshDataSourceTree()
Action newToggleShowRejectedAction()
ExplorerManager getExplorerManager()
javax.swing.JButton backButton
static final String HIDE_SLACK_FILES_IN_DATA_SRCS_TREE
SleuthkitCase getSleuthkitCase()
static DirectoryTreeTopComponent instance
void addOnFinishedListener(PropertyChangeListener l)
void addIngestModuleEventListener(final PropertyChangeListener listener)
static boolean isEmptyMimeTypeNode(Node node)
static Case getCurrentCase()
synchronized static Logger getLogger(String name)
static void addChangeListener(PreferenceChangeListener listener)
void setChildNodeSelectionInfo(NodeSelectionInfo selectedChildNodeInfo)
void forwardButtonActionPerformed(java.awt.event.ActionEvent evt)
void subscribeToChangeEvents()
static synchronized DirectoryTreeTopComponent findInstance()
void setPath(String pathText)
static boolean isCaseOpen()
static void addEventSubscriber(Set< String > eventNames, PropertyChangeListener subscriber)
void setNode(Node selectedNode)