Autopsy  4.8.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
CaseDBCommonAttributeInstanceNode.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2018 Basis Technology Corp.
5  * Contact: carrier <at> sleuthkit <dot> org
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 package org.sleuthkit.autopsy.commonfilesearch;
20 
21 import java.util.List;
22 import org.apache.commons.lang3.StringUtils;
23 import org.openide.nodes.Sheet;
30 import org.sleuthkit.datamodel.AbstractFile;
31 import org.sleuthkit.datamodel.ContentTag;
32 
38 
39  private final String caseName;
40  private final String dataSource;
41 
51  public CaseDBCommonAttributeInstanceNode(AbstractFile fsContent, String caseName, String dataSource) {
52  super(fsContent);
53  this.caseName = caseName;
54  this.dataSource = dataSource;
55  }
56 
57  @Override
58  public boolean isLeafTypeNode() {
59  //Not used atm - could maybe be leveraged for better use in Children objects
60  return true;
61  }
62 
63  @Override
64  public <T> T accept(DisplayableItemNodeVisitor<T> visitor) {
65  return visitor.visit(this);
66  }
67 
68  public String getCase() {
69  return this.caseName;
70  }
71 
72  public String getDataSource() {
73  return this.dataSource;
74  }
75 
76  @Override
77  protected Sheet createSheet() {
78  Sheet sheet = new Sheet();
79  Sheet.Set sheetSet = sheet.get(Sheet.PROPERTIES);
80  if (sheetSet == null) {
81  sheetSet = Sheet.createPropertiesSet();
82  sheet.put(sheetSet);
83  }
84  List<ContentTag> tags = getContentTagsFromDatabase();
85 
86  final String NO_DESCR = Bundle.CommonFilesSearchResultsViewerTable_noDescText();
87 
88  sheetSet.put(new NodeProperty<>(Bundle.CommonFilesSearchResultsViewerTable_filesColLbl(), Bundle.CommonFilesSearchResultsViewerTable_filesColLbl(), NO_DESCR, this.getContent().getName()));
89 
90  addScoreProperty(sheetSet, tags);
91 
92  CorrelationAttributeInstance correlationAttribute = null;
94  correlationAttribute = getCorrelationAttributeInstance();
95  }
96  addCommentProperty(sheetSet, tags, correlationAttribute);
97 
99  addCountProperty(sheetSet, correlationAttribute);
100  }
101  sheetSet.put(new NodeProperty<>(Bundle.CommonFilesSearchResultsViewerTable_pathColLbl(), Bundle.CommonFilesSearchResultsViewerTable_pathColLbl(), NO_DESCR, this.getContent().getParentPath()));
102  sheetSet.put(new NodeProperty<>(Bundle.CommonFilesSearchResultsViewerTable_dataSourceColLbl(), Bundle.CommonFilesSearchResultsViewerTable_dataSourceColLbl(), NO_DESCR, this.getDataSource()));
103  sheetSet.put(new NodeProperty<>(Bundle.CommonFilesSearchResultsViewerTable_mimeTypeColLbl(), Bundle.CommonFilesSearchResultsViewerTable_mimeTypeColLbl(), NO_DESCR, StringUtils.defaultString(this.getContent().getMIMEType())));
104  sheetSet.put(new NodeProperty<>(Bundle.CommonFilesSearchResultsViewerTable_caseColLbl1(), Bundle.CommonFilesSearchResultsViewerTable_caseColLbl1(), NO_DESCR, caseName));
105  return sheet;
106  }
107 }
CaseDBCommonAttributeInstanceNode(AbstractFile fsContent, String caseName, String dataSource)

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.