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.EnumSet;
 
   30 import java.util.HashSet;
 
   31 import java.util.LinkedList;
 
   32 import java.util.List;
 
   34 import java.util.concurrent.ExecutionException;
 
   35 import java.util.logging.Level;
 
   36 import java.util.prefs.PreferenceChangeEvent;
 
   37 import java.util.prefs.PreferenceChangeListener;
 
   38 import javax.swing.Action;
 
   39 import javax.swing.SwingUtilities;
 
   40 import javax.swing.SwingWorker;
 
   41 import javax.swing.tree.TreeSelectionModel;
 
   42 import org.apache.commons.lang3.StringUtils;
 
   43 import org.openide.explorer.ExplorerManager;
 
   44 import org.openide.explorer.ExplorerUtils;
 
   45 import org.openide.explorer.view.BeanTreeView;
 
   46 import org.openide.explorer.view.TreeView;
 
   47 import org.openide.nodes.AbstractNode;
 
   48 import org.openide.nodes.Children;
 
   49 import org.openide.nodes.Node;
 
   50 import org.openide.nodes.NodeNotFoundException;
 
   51 import org.openide.nodes.NodeOp;
 
   52 import org.openide.util.NbBundle;
 
   53 import org.openide.util.NbBundle.Messages;
 
   54 import org.openide.windows.TopComponent;
 
   55 import org.openide.windows.WindowManager;
 
  100     "DirectoryTreeTopComponent.resultsView.title=Listing" 
  104     private final transient ExplorerManager em = 
new ExplorerManager();
 
  109     private static final String PREFERRED_ID = 
"DirectoryTreeTopComponent"; 
 
  120         getTree().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
 
  122         putClientProperty(TopComponent.PROP_CLOSING_DISABLED, Boolean.TRUE);
 
  126         subscribeToChangeEvents();
 
  127         associateLookup(ExplorerUtils.createLookup(em, getActionMap()));
 
  130         this.backList = 
new LinkedList<>();
 
  131         this.forwardList = 
new LinkedList<>();
 
  132         backButton.setEnabled(
false);
 
  133         forwardButton.setEnabled(
false);
 
  142             public void preferenceChange(PreferenceChangeEvent evt) {
 
  143                 switch (evt.getKey()) {
 
  146                         refreshContentTreeSafe();
 
  156         this.em.addPropertyChangeListener(
this);
 
  162         this.dataResult.requestActive();
 
  166         this.dataResult.
open();
 
  170         return this.dataResult;
 
  181         treeView = 
new BeanTreeView();
 
  182         backButton = 
new javax.swing.JButton();
 
  183         forwardButton = 
new javax.swing.JButton();
 
  184         showRejectedCheckBox = 
new javax.swing.JCheckBox();
 
  186         treeView.setBorder(null);
 
  188         backButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/directorytree/btn_step_back.png"))); 
 
  189         org.openide.awt.Mnemonics.setLocalizedText(backButton, 
org.openide.util.NbBundle.getMessage(
DirectoryTreeTopComponent.class, 
"DirectoryTreeTopComponent.backButton.text")); 
 
  190         backButton.setBorderPainted(
false);
 
  191         backButton.setContentAreaFilled(
false);
 
  192         backButton.setDisabledIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/directorytree/btn_step_back_disabled.png"))); 
 
  193         backButton.setMargin(
new java.awt.Insets(2, 0, 2, 0));
 
  194         backButton.setMaximumSize(
new java.awt.Dimension(55, 100));
 
  195         backButton.setMinimumSize(
new java.awt.Dimension(5, 5));
 
  196         backButton.setPreferredSize(
new java.awt.Dimension(23, 23));
 
  197         backButton.setRolloverIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/directorytree/btn_step_back_hover.png"))); 
 
  198         backButton.addActionListener(
new java.awt.event.ActionListener() {
 
  199             public void actionPerformed(java.awt.event.ActionEvent evt) {
 
  200                 backButtonActionPerformed(evt);
 
  204         forwardButton.setIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/directorytree/btn_step_forward.png"))); 
 
  205         org.openide.awt.Mnemonics.setLocalizedText(forwardButton, 
org.openide.util.NbBundle.getMessage(
DirectoryTreeTopComponent.class, 
"DirectoryTreeTopComponent.forwardButton.text")); 
 
  206         forwardButton.setBorderPainted(
false);
 
  207         forwardButton.setContentAreaFilled(
false);
 
  208         forwardButton.setDisabledIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/directorytree/btn_step_forward_disabled.png"))); 
 
  209         forwardButton.setMargin(
new java.awt.Insets(2, 0, 2, 0));
 
  210         forwardButton.setMaximumSize(
new java.awt.Dimension(55, 100));
 
  211         forwardButton.setMinimumSize(
new java.awt.Dimension(5, 5));
 
  212         forwardButton.setPreferredSize(
new java.awt.Dimension(23, 23));
 
  213         forwardButton.setRolloverIcon(
new javax.swing.ImageIcon(getClass().getResource(
"/org/sleuthkit/autopsy/directorytree/btn_step_forward_hover.png"))); 
 
  214         forwardButton.addActionListener(
new java.awt.event.ActionListener() {
 
  215             public void actionPerformed(java.awt.event.ActionEvent evt) {
 
  216                 forwardButtonActionPerformed(evt);
 
  220         org.openide.awt.Mnemonics.setLocalizedText(showRejectedCheckBox, 
org.openide.util.NbBundle.getMessage(
DirectoryTreeTopComponent.class, 
"DirectoryTreeTopComponent.showRejectedCheckBox.text")); 
 
  222         javax.swing.GroupLayout layout = 
new javax.swing.GroupLayout(
this);
 
  223         this.setLayout(layout);
 
  224         layout.setHorizontalGroup(
 
  225             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 
  226             .addComponent(treeView, javax.swing.GroupLayout.DEFAULT_SIZE, 262, Short.MAX_VALUE)
 
  227             .addGroup(layout.createSequentialGroup()
 
  229                 .addComponent(backButton, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
 
  231                 .addComponent(forwardButton, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
 
  232                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 46, Short.MAX_VALUE)
 
  233                 .addComponent(showRejectedCheckBox)
 
  236         layout.setVerticalGroup(
 
  237             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 
  238             .addGroup(layout.createSequentialGroup()
 
  240                 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
 
  241                     .addComponent(forwardButton, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
 
  242                     .addComponent(backButton, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
 
  243                     .addComponent(showRejectedCheckBox))
 
  244                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 
  245                 .addComponent(treeView, javax.swing.GroupLayout.DEFAULT_SIZE, 854, Short.MAX_VALUE)
 
  252         this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
 
  255         String[] currentNodePath = backList.pollLast();
 
  256         forwardList.addLast(currentNodePath);
 
  257         forwardButton.setEnabled(
true);
 
  264         String[] newCurrentNodePath = backList.peekLast();
 
  267         if (backList.size() > 1) {
 
  268             backButton.setEnabled(
true);
 
  270             backButton.setEnabled(
false);
 
  274         setSelectedNode(newCurrentNodePath, null);
 
  276         this.setCursor(null);
 
  281         this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
 
  283         String[] newCurrentNodePath = forwardList.pollLast();
 
  284         if (!forwardList.isEmpty()) {
 
  285             forwardButton.setEnabled(
true);
 
  287             forwardButton.setEnabled(
false);
 
  290         backList.addLast(newCurrentNodePath);
 
  291         backButton.setEnabled(
true);
 
  294         setSelectedNode(newCurrentNodePath, null);
 
  296         this.setCursor(null);
 
  315         if (instance == null) {
 
  328         WindowManager winManager = WindowManager.
getDefault();
 
  329         TopComponent win = winManager.findTopComponent(PREFERRED_ID);
 
  332                     "Cannot find " + PREFERRED_ID + 
" component. It will not be located properly in the window system."); 
 
  336             return (DirectoryTreeTopComponent) win;
 
  339                 "There seem to be multiple components with the '" + PREFERRED_ID 
 
  340                 + 
"' ID. That is a potential source of errors and unexpected behavior."); 
 
  352         return TopComponent.PERSISTENCE_NEVER;
 
  365         this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
 
  366         Case currentCase = null;
 
  369         } 
catch (IllegalStateException ex) {
 
  374         if (null == currentCase || currentCase.hasData() == 
false) {
 
  375             getTree().setRootVisible(
false); 
 
  385             Node root = 
new AbstractNode(contentChildren) {
 
  392                 public Action[] getActions(
boolean popup) {
 
  393                     return new Action[]{};
 
  399                 public Node.Handle getHandle() {
 
  400                     return new Node.Handle() {
 
  402                         public Node getNode() 
throws IOException {
 
  403                             return em.getRootContext();
 
  409             root = 
new DirectoryTreeFilterNode(root, 
true);
 
  411             em.setRootContext(root);
 
  412             em.getRootContext().setName(currentCase.getName());
 
  413             em.getRootContext().setDisplayName(currentCase.getName());
 
  414             getTree().setRootVisible(
false); 
 
  418             new SwingWorker<Node[], Void>() {
 
  420                 protected Node[] doInBackground() 
throws Exception {
 
  421                     Children rootChildren = em.getRootContext().getChildren();
 
  422                     TreeView tree = getTree();
 
  425                     tree.expandNode(results);
 
  426                     Children resultsChildren = results.getChildren();
 
  427                     Arrays.stream(resultsChildren.getNodes()).forEach(tree::expandNode);
 
  431                     showRejectedCheckBox.setSelected(
false);
 
  434                     Arrays.stream(views.getChildren().getNodes()).forEach(tree::expandNode);
 
  435                     tree.collapseNode(views);
 
  445                     if (rootChildren.getNodesCount() > 0) {
 
  446                         return new Node[]{rootChildren.getNodeAt(0)};
 
  452                 protected void done() {
 
  456                     if (!dataResult.isOpened()) {
 
  467                         em.setSelectedNodes(
get());
 
  468                     } 
catch (PropertyVetoException ex) {
 
  469                         LOGGER.log(Level.SEVERE, 
"Error setting default selected node.", ex); 
 
  470                     } 
catch (InterruptedException | ExecutionException ex) {
 
  471                         LOGGER.log(Level.SEVERE, 
"Error expanding tree to initial state.", ex); 
 
  489         contentChildren = null;
 
  492     void writeProperties(java.util.Properties p) {
 
  495         p.setProperty(
"version", 
"1.0");
 
  499     Object readProperties(java.util.Properties p) {
 
  500         if (instance == null) {
 
  508         String version = p.getProperty(
"version");
 
  549         return new Action[]{};
 
  560         Node[] selectedNodes = this.getExplorerManager().getSelectedNodes();
 
  561         if (selectedNodes.length > 0) {
 
  562             result = selectedNodes[0];
 
  576             String changed = evt.getPropertyName();
 
  586                 if (evt.getOldValue() != null && evt.getNewValue() == null) {
 
  588                     SwingUtilities.invokeLater(() -> {
 
  589                         Node emptyNode = 
new AbstractNode(Children.LEAF);
 
  590                         em.setRootContext(emptyNode);
 
  592                 } 
else if (evt.getNewValue() != null) {
 
  594                     Case newCase = (
Case) evt.getNewValue();
 
  595                     final String newCaseName = newCase.
getName();
 
  596                     SwingUtilities.invokeLater(() -> {
 
  597                         em.getRootContext().setName(newCaseName);
 
  598                         em.getRootContext().setDisplayName(newCaseName);
 
  624                 } 
catch (IllegalStateException | TskCoreException notUsed) {
 
  630             else if (changed.equals(ExplorerManager.PROP_SELECTED_NODES)) {
 
  631                 respondSelection((Node[]) evt.getOldValue(), (Node[]) evt.getNewValue());
 
  647     @NbBundle.Messages(
"DirectoryTreeTopComponent.emptyMimeNode.text=Data not available. Run file type identification module.")
 
  658         EventQueue.invokeLater(() -> {
 
  663                 if (treeNode != null) {
 
  664                     Node originNode = ((DirectoryTreeFilterNode) treeNode).getOriginal();
 
  671                         EmptyNode emptyNode = 
new EmptyNode(Bundle.DirectoryTreeTopComponent_emptyMimeNode_text());
 
  678                     String displayName = 
"";
 
  679                     Content content = originNode.getLookup().lookup(Content.class);
 
  680                     if (content != null) {
 
  682                             displayName = content.getUniquePath();
 
  683                         } 
catch (TskCoreException ex) {
 
  684                             LOGGER.log(Level.SEVERE, 
"Exception while calling Content.getUniquePath() for node: {0}", originNode); 
 
  686                     } 
else if (originNode.getLookup().lookup(String.class) != null) {
 
  687                         displayName = originNode.getLookup().lookup(String.class);
 
  689                     dataResult.
setPath(displayName);
 
  692                 if (oldNodes != null && newNodes != null
 
  693                         && (oldNodes.length == newNodes.length)) {
 
  694                     boolean sameNodes = 
true;
 
  695                     for (
int i = 0; i < oldNodes.length; i++) {
 
  696                         sameNodes = sameNodes && oldNodes[i].getName().equals(newNodes[i].getName());
 
  699                         dataResult.requestActive();
 
  708         updateHistory(em.getSelectedNodes());
 
  712         if (selectedNodes.length == 0) {
 
  716         Node selectedNode = selectedNodes[0];
 
  717         String selectedNodeName = selectedNode.getName();
 
  725         String[] currentLast = backList.peekLast();
 
  726         String lastNodeName = null;
 
  727         if (currentLast != null) {
 
  728             lastNodeName = currentLast[currentLast.length - 1];
 
  731         if (currentLast == null || !selectedNodeName.equals(lastNodeName)) {
 
  733             final String[] selectedPath = NodeOp.createPath(selectedNode, em.getRootContext());
 
  734             backList.addLast(selectedPath); 
 
  735             if (backList.size() > 1) {
 
  736                 backButton.setEnabled(
true);
 
  738                 backButton.setEnabled(
false);
 
  742             forwardButton.setEnabled(
false); 
 
  754         backButton.setEnabled(
false);
 
  755         forwardButton.setEnabled(
false);
 
  764         return (BeanTreeView) this.treeView;
 
  771         SwingUtilities.invokeLater(this::refreshDataSourceTree);
 
  778         Node selectedNode = getSelectedNode();
 
  779         final String[] selectedPath = NodeOp.createPath(selectedNode, em.getRootContext());
 
  780         Children rootChildren = em.getRootContext().getChildren();
 
  782         if (dataSourcesFilterNode == null) {
 
  783             LOGGER.log(Level.SEVERE, 
"Cannot find data sources filter node, won't refresh the content tree"); 
 
  786         Node dataSourcesNode = ((DirectoryTreeFilterNode) dataSourcesFilterNode).getOriginal();
 
  799     private void setSelectedNode(
final String[] previouslySelectedNodePath, 
final String rootNodeName) {
 
  800         if (previouslySelectedNodePath == null) {
 
  803         SwingUtilities.invokeLater(
new Runnable() {
 
  806                 if (previouslySelectedNodePath.length > 0 && (rootNodeName == null || previouslySelectedNodePath[0].equals(rootNodeName))) {
 
  807                     Node selectedNode = null;
 
  808                     ArrayList<String> selectedNodePath = 
new ArrayList<>(Arrays.asList(previouslySelectedNodePath));
 
  809                     while (null == selectedNode && !selectedNodePath.isEmpty()) {
 
  811                             selectedNode = NodeOp.findPath(em.getRootContext(), selectedNodePath.toArray(
new String[selectedNodePath.size()]));
 
  812                         } 
catch (NodeNotFoundException ex) {
 
  814                             if (selectedNodePath.size() > 1) {
 
  815                                 selectedNodePath.remove(selectedNodePath.size() - 1);
 
  817                                 StringBuilder nodePath = 
new StringBuilder();
 
  818                                 for (
int i = 0; i < previouslySelectedNodePath.length; ++i) {
 
  819                                     nodePath.append(previouslySelectedNodePath[i]).append(
"/");
 
  821                                 LOGGER.log(Level.WARNING, 
"Failed to find any nodes to select on path " + nodePath.toString(), ex); 
 
  827                     if (null != selectedNode) {
 
  828                         if (rootNodeName != null) {
 
  834                             em.setExploredContextAndSelection(selectedNode, 
new Node[]{selectedNode});
 
  835                         } 
catch (PropertyVetoException ex) {
 
  836                             LOGGER.log(Level.WARNING, 
"Property veto from ExplorerManager setting selection to " + selectedNode.getName(), ex); 
 
  856         int typeID = art.getArtifactTypeID();
 
  857         String typeName = art.getArtifactTypeName();
 
  858         Children rootChilds = em.getRootContext().getChildren();
 
  859         Node treeNode = null;
 
  861         Children resultsChilds = resultsNode.getChildren();
 
  862         if (typeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_HASHSET_HIT.getTypeID()) {
 
  863             Node hashsetRootNode = resultsChilds.findChild(typeName);
 
  864             Children hashsetRootChilds = hashsetRootNode.getChildren();
 
  866                 String setName = null;
 
  867                 List<BlackboardAttribute> attributes = art.getAttributes();
 
  868                 for (BlackboardAttribute att : attributes) {
 
  869                     int typeId = att.getAttributeType().getTypeID();
 
  870                     if (typeId == BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SET_NAME.getTypeID()) {
 
  871                         setName = att.getValueString();
 
  874                 treeNode = hashsetRootChilds.findChild(setName);
 
  875             } 
catch (TskCoreException ex) {
 
  876                 LOGGER.log(Level.WARNING, 
"Error retrieving attributes", ex); 
 
  878         } 
else if (typeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_KEYWORD_HIT.getTypeID()) {
 
  879             Node keywordRootNode = resultsChilds.findChild(typeName);
 
  880             Children keywordRootChilds = keywordRootNode.getChildren();
 
  882                 String listName = null;
 
  883                 String keywordName = null;
 
  885                 List<BlackboardAttribute> attributes = art.getAttributes();
 
  886                 for (BlackboardAttribute att : attributes) {
 
  887                     int typeId = att.getAttributeType().getTypeID();
 
  888                     if (typeId == BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SET_NAME.getTypeID()) {
 
  889                         listName = att.getValueString();
 
  890                     } 
else if (typeId == BlackboardAttribute.ATTRIBUTE_TYPE.TSK_KEYWORD.getTypeID()) {
 
  891                         keywordName = att.getValueString();
 
  892                     } 
else if (typeId == BlackboardAttribute.ATTRIBUTE_TYPE.TSK_KEYWORD_REGEXP.getTypeID()) {
 
  893                         regex = att.getValueString();
 
  896                 if (listName == null) {
 
  898                         listName = NbBundle.getMessage(
KeywordHits.class, 
"KeywordHits.simpleLiteralSearch.text");
 
  900                         listName = NbBundle.getMessage(
KeywordHits.class, 
"KeywordHits.singleRegexSearch.text");
 
  903                 Node listNode = keywordRootChilds.findChild(listName);
 
  904                 if (listNode == null) {
 
  907                 Children listChildren = listNode.getChildren();
 
  908                 if (listChildren == null) {
 
  912                     Node regexNode = listChildren.findChild(regex);
 
  913                     if (regexNode == null) {
 
  916                     listChildren = regexNode.getChildren();
 
  917                     if (listChildren == null) {
 
  922                 treeNode = listChildren.findChild(keywordName);
 
  924             } 
catch (TskCoreException ex) {
 
  925                 LOGGER.log(Level.WARNING, 
"Error retrieving attributes", ex); 
 
  927         } 
else if (typeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_FILE_HIT.getTypeID()
 
  928                 || typeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_ARTIFACT_HIT.getTypeID()) {
 
  929             Node interestingItemsRootNode = resultsChilds.findChild(NbBundle
 
  930                     .getMessage(
InterestingHits.class, 
"InterestingHits.interestingItems.text"));
 
  931             Children interestingItemsRootChildren = interestingItemsRootNode.getChildren();
 
  933                 String setName = null;
 
  934                 List<BlackboardAttribute> attributes = art.getAttributes();
 
  935                 for (BlackboardAttribute att : attributes) {
 
  936                     int typeId = att.getAttributeType().getTypeID();
 
  937                     if (typeId == BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SET_NAME.getTypeID()) {
 
  938                         setName = att.getValueString();
 
  941                 Node setNode = interestingItemsRootChildren.findChild(setName);
 
  942                 if (setNode == null) {
 
  945                 Children interestingChildren = setNode.getChildren();
 
  946                 if (interestingChildren == null) {
 
  949                 treeNode = interestingChildren.findChild(art.getDisplayName());
 
  950             } 
catch (TskCoreException ex) {
 
  951                 LOGGER.log(Level.WARNING, 
"Error retrieving attributes", ex); 
 
  953         } 
else if (typeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_EMAIL_MSG.getTypeID()) {
 
  954             Node emailMsgRootNode = resultsChilds.findChild(typeName);
 
  955             Children emailMsgRootChilds = emailMsgRootNode.getChildren();
 
  956             Map<String, String> parsedPath = null;
 
  958                 List<BlackboardAttribute> attributes = art.getAttributes();
 
  959                 for (BlackboardAttribute att : attributes) {
 
  960                     int typeId = att.getAttributeType().getTypeID();
 
  961                     if (typeId == BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PATH.getTypeID()) {
 
  966                 if (parsedPath == null) {
 
  969                 Node defaultNode = emailMsgRootChilds.findChild(parsedPath.get(NbBundle.getMessage(
EmailExtracted.class, 
"EmailExtracted.defaultAcct.text")));
 
  970                 Children defaultChildren = defaultNode.getChildren();
 
  971                 treeNode = defaultChildren.findChild(parsedPath.get(NbBundle.getMessage(
EmailExtracted.class, 
"EmailExtracted.defaultFolder.text")));
 
  972             } 
catch (TskCoreException ex) {
 
  973                 LOGGER.log(Level.WARNING, 
"Error retrieving attributes", ex); 
 
  976         } 
else if (typeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_ACCOUNT.getTypeID()) {
 
  977             Node accountRootNode = resultsChilds.findChild(art.getDisplayName());
 
  978             Children accountRootChilds = accountRootNode.getChildren();
 
  979             List<BlackboardAttribute> attributes;
 
  980             String accountType = null;
 
  981             String ccNumberName = null;
 
  983                 attributes = art.getAttributes();
 
  984                 for (BlackboardAttribute att : attributes) {
 
  985                     int typeId = att.getAttributeType().getTypeID();
 
  986                     if (typeId == BlackboardAttribute.ATTRIBUTE_TYPE.TSK_ACCOUNT_TYPE.getTypeID()) {
 
  987                         accountType = att.getValueString();
 
  989                     if (typeId == BlackboardAttribute.ATTRIBUTE_TYPE.TSK_CARD_NUMBER.getTypeID()) {
 
  990                         ccNumberName = att.getValueString();
 
  993                 if (accountType == null) {
 
  997                 if (accountType.equals(Account.Type.CREDIT_CARD.name())) {
 
  998                     Node accountNode = accountRootChilds.findChild(Account.Type.CREDIT_CARD.getDisplayName());
 
  999                     if (accountNode == null) {
 
 1002                     Children accountChildren = accountNode.getChildren();
 
 1003                     if (accountChildren == null) {
 
 1006                     Node binNode = accountChildren.findChild(NbBundle.getMessage(
Accounts.class, 
"Accounts.ByBINNode.name"));
 
 1007                     if (binNode == null) {
 
 1010                     Children binChildren = binNode.getChildren();
 
 1011                     if (ccNumberName == null) {
 
 1016                     String binName = StringUtils.rightPad(ccNumberName, 8, 
"0");
 
 1017                     binName = binName.substring(0, 8);
 
 1020                         bin = Integer.parseInt(binName);
 
 1021                     } 
catch (NumberFormatException ex) {
 
 1022                         LOGGER.log(Level.WARNING, 
"Unable to parseInt a BIN for node selection from string binName=" + binName, ex); 
 
 1026                     if (binInfo != null) {
 
 1027                         int startBin = ((
BINRange) binInfo).getBINstart();
 
 1028                         int endBin = ((
BINRange) binInfo).getBINend();
 
 1029                         if (startBin != endBin) {
 
 1030                             binName = Integer.toString(startBin) + 
"-" + Integer.toString(endBin).substring(5); 
 
 1033                     if (binName == null) {
 
 1036                     treeNode = binChildren.findChild(binName);
 
 1038                     treeNode = accountRootChilds.findChild(accountType);
 
 1040             } 
catch (TskCoreException ex) {
 
 1041                 LOGGER.log(Level.WARNING, 
"Error retrieving attributes", ex); 
 
 1045             Children extractedChilds = extractedContent.getChildren();
 
 1046             if (extractedChilds == null) {
 
 1049             treeNode = extractedChilds.findChild(typeName);
 
 1052         if (treeNode == null) {
 
 1058         getTree().expandNode(treeNode);
 
 1060             em.setExploredContextAndSelection(treeNode, 
new Node[]{treeNode});
 
 1061         } 
catch (PropertyVetoException ex) {
 
 1062             LOGGER.log(Level.WARNING, 
"Property Veto: ", ex); 
 
 1070                 NbBundle.getMessage(
this.getClass(), 
"DirectoryTreeTopComponent.action.viewArtContent.text"),
 
 1079     void fireViewerComplete() {
 
 1083         } 
catch (Exception e) {
 
 1084             LOGGER.log(Level.SEVERE, 
"DirectoryTreeTopComponent listener threw exception", e); 
 
 1085             MessageNotifyUtil.Notify.show(NbBundle.getMessage(
this.getClass(), 
"DirectoryTreeTopComponent.moduleErr"),
 
 1086                     NbBundle.getMessage(
this.getClass(),
 
 1087                             "DirectoryTreeTopComponent.moduleErr.msg"),
 
 1088                     MessageNotifyUtil.MessageType.ERROR);
 
List< Content > getDataSources()
 
TopComponent getTopComponent()
 
void viewArtifact(final BlackboardArtifact art)
 
static final String HIDE_SLACK_FILES_IN_VIEWS_TREE
 
javax.swing.JScrollPane treeView
 
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()
 
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 addEventTypeSubscriber(Set< Events > eventTypes, PropertyChangeListener subscriber)
 
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()
 
void setNode(Node selectedNode)