Autopsy  4.8.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
CaseDBCommonAttributeInstance.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.util.Arrays;
23 import java.util.logging.Level;
29 import org.sleuthkit.datamodel.AbstractFile;
30 import org.sleuthkit.datamodel.SleuthkitCase;
31 import org.sleuthkit.datamodel.TskCoreException;
32 
37 
38  private static final Logger LOGGER = Logger.getLogger(CaseDBCommonAttributeInstance.class.getName());
39 
40 
48  CaseDBCommonAttributeInstance(Long abstractFileReference, String dataSource, String caseName) {
49  super(abstractFileReference, dataSource, caseName);
50  }
51 
52  @Override
54  final CaseDBCommonAttributeInstanceNode intraCaseCommonAttributeInstanceNode = new CaseDBCommonAttributeInstanceNode(this.getAbstractFile(), this.getCaseName(), this.getDataSource());
55  return Arrays.asList(intraCaseCommonAttributeInstanceNode).toArray(new DisplayableItemNode[1]);
56  }
57 
58  @Override
59  AbstractFile getAbstractFile() {
60 
61  Case currentCase;
62  try {
63  currentCase = Case.getCurrentCaseThrows();
64 
65  SleuthkitCase tskDb = currentCase.getSleuthkitCase();
66 
67  return tskDb.findAllFilesWhere(String.format("obj_id in (%s)", this.getAbstractFileObjectId())).get(0);
68 
69  } catch (TskCoreException | NoCurrentCaseException ex) {
70  LOGGER.log(Level.SEVERE, String.format("Unable to find AbstractFile for record with obj_id: %s. Node not created.", new Object[]{this.getAbstractFileObjectId()}), ex);
71  return null;
72  }
73  }
74 
75  @Override
77  //may be required at a later date
78  throw new UnsupportedOperationException("Not supported yet.");
79  }
80 }
synchronized static Logger getLogger(String name)
Definition: Logger.java:124

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.