Autopsy  4.8.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
CentralRepoCommonAttributeInstanceNode.java
Go to the documentation of this file.
1 /*
2  *
3  * Autopsy Forensic Browser
4  *
5  * Copyright 2018 Basis Technology Corp.
6  * Contact: carrier <at> sleuthkit <dot> org
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 package org.sleuthkit.autopsy.commonfilesearch;
21 
22 import java.io.File;
23 import java.util.ArrayList;
24 import java.util.Arrays;
25 import java.util.List;
26 import javax.swing.Action;
27 import org.openide.nodes.Children;
28 import org.openide.nodes.Sheet;
29 import org.openide.util.lookup.Lookups;
34 
44 
46 
48  super(Children.LEAF, Lookups.fixed(content));
49  this.crFile = content;
50  this.setDisplayName(new File(this.crFile.getFilePath()).getName());
51  }
52 
54  return this.crFile;
55  }
56 
57  @Override
58  public Action[] getActions(boolean context){
59  List<Action> actionsList = new ArrayList<>();
60 
61  actionsList.addAll(Arrays.asList(super.getActions(true)));
62 
63  return actionsList.toArray(new Action[actionsList.size()]);
64  }
65 
66  @Override
67  public <T> T accept(DisplayableItemNodeVisitor<T> visitor) {
68  return visitor.visit(this);
69  }
70 
71  @Override
72  public boolean isLeafTypeNode() {
73  return true;
74  }
75 
76  @Override
77  public String getItemType() {
78  //objects of type FileNode will co-occur in the treetable with objects
79  // of this type and they will need to provide the same key
80  return CaseDBCommonAttributeInstanceNode.class.getName();
81  }
82 
83  @Override
84  protected Sheet createSheet(){
85  Sheet sheet = new Sheet();
86  Sheet.Set sheetSet = sheet.get(Sheet.PROPERTIES);
87 
88  if(sheetSet == null){
89  sheetSet = Sheet.createPropertiesSet();
90  sheet.put(sheetSet);
91  }
92 
94 
95  final String fullPath = centralRepoFile.getFilePath();
96  final File file = new File(fullPath);
97 
98  final String caseName = centralRepoFile.getCorrelationCase().getDisplayName();
99 
100  final String name = file.getName();
101  final String parent = file.getParent();
102 
103  final String dataSourceName = centralRepoFile.getCorrelationDataSource().getName();
104 
105  final String NO_DESCR = Bundle.CommonFilesSearchResultsViewerTable_noDescText();
106 
107  sheetSet.put(new NodeProperty<>(org.sleuthkit.autopsy.commonfilesearch.Bundle.CommonFilesSearchResultsViewerTable_filesColLbl(), org.sleuthkit.autopsy.commonfilesearch.Bundle.CommonFilesSearchResultsViewerTable_filesColLbl(), NO_DESCR, name));
108  sheetSet.put(new NodeProperty<>(org.sleuthkit.autopsy.commonfilesearch.Bundle.CommonFilesSearchResultsViewerTable_pathColLbl(), org.sleuthkit.autopsy.commonfilesearch.Bundle.CommonFilesSearchResultsViewerTable_pathColLbl(), NO_DESCR, parent));
109  sheetSet.put(new NodeProperty<>(org.sleuthkit.autopsy.commonfilesearch.Bundle.CommonFilesSearchResultsViewerTable_hashsetHitsColLbl(), org.sleuthkit.autopsy.commonfilesearch.Bundle.CommonFilesSearchResultsViewerTable_hashsetHitsColLbl(), NO_DESCR, ""));
110  sheetSet.put(new NodeProperty<>(org.sleuthkit.autopsy.commonfilesearch.Bundle.CommonFilesSearchResultsViewerTable_dataSourceColLbl(), org.sleuthkit.autopsy.commonfilesearch.Bundle.CommonFilesSearchResultsViewerTable_dataSourceColLbl(), NO_DESCR, dataSourceName));
111  sheetSet.put(new NodeProperty<>(org.sleuthkit.autopsy.commonfilesearch.Bundle.CommonFilesSearchResultsViewerTable_mimeTypeColLbl(), org.sleuthkit.autopsy.commonfilesearch.Bundle.CommonFilesSearchResultsViewerTable_mimeTypeColLbl(), NO_DESCR, ""));
112  sheetSet.put(new NodeProperty<>(org.sleuthkit.autopsy.commonfilesearch.Bundle.CommonFilesSearchResultsViewerTable_caseColLbl1(), org.sleuthkit.autopsy.commonfilesearch.Bundle.CommonFilesSearchResultsViewerTable_caseColLbl1(), NO_DESCR, caseName));
113 
114  return sheet;
115  }
116 }

Copyright © 2012-2018 Basis Technology. Generated on: Thu Oct 4 2018
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.