19 package org.sleuthkit.autopsy.centralrepository.contentviewer;
 
   33 class OtherOccurrenceNodeInstanceData 
implements OtherOccurrenceNodeData {
 
   37     private static final String FILE_TYPE_STR = 
"Files";
 
   39     private final String caseName;
 
   40     private String deviceID;
 
   41     private String dataSourceName;
 
   42     private final String filePath;
 
   43     private final String typeStr;
 
   44     private final String value;
 
   45     private TskData.FileKnown known;
 
   46     private String comment;
 
   48     private AbstractFile originalAbstractFile = null;
 
   49     private CorrelationAttributeInstance originalCorrelationInstance = null;
 
   57     OtherOccurrenceNodeInstanceData(CorrelationAttributeInstance instance, CorrelationAttributeInstance.Type type, String value) {
 
   58         caseName = instance.getCorrelationCase().getDisplayName();
 
   59         deviceID = instance.getCorrelationDataSource().getDeviceID();
 
   60         dataSourceName = instance.getCorrelationDataSource().getName();
 
   61         filePath = instance.getFilePath();
 
   62         this.typeStr = type.getDisplayName();
 
   64         known = instance.getKnownStatus();
 
   65         comment = instance.getComment();
 
   67         originalCorrelationInstance = instance;
 
   76     OtherOccurrenceNodeInstanceData(AbstractFile newFile, Case autopsyCase) 
throws EamDbException {
 
   77         caseName = autopsyCase.getDisplayName();
 
   79             DataSource dataSource = autopsyCase.getSleuthkitCase().getDataSource(newFile.getDataSource().getId());
 
   80             deviceID = dataSource.getDeviceId();
 
   81             dataSourceName = dataSource.getName();
 
   82         } 
catch (TskDataException | TskCoreException ex) {
 
   83             throw new EamDbException(
"Error loading data source for abstract file ID " + newFile.getId(), ex);
 
   86         filePath = newFile.getParentPath() + newFile.getName();
 
   87         typeStr = FILE_TYPE_STR;
 
   88         value = newFile.getMd5Hash();
 
   89         known = newFile.getKnown();
 
   92         originalAbstractFile = newFile;
 
   99     boolean isFileType() {
 
  100         return FILE_TYPE_STR.equals(typeStr);
 
  107     void updateKnown(TskData.FileKnown newKnownStatus) {
 
  108         known = newKnownStatus;
 
  115     void updateComment(String newComment) {
 
  116         comment = newComment;
 
  123     boolean isCentralRepoNode() {
 
  124         return (originalCorrelationInstance != null);
 
  131     String getCaseName() {
 
  139     String getDeviceID() {
 
  147     String getDataSourceName() {
 
  148         return dataSourceName;
 
  155     String getFilePath() {
 
  179     TskData.FileKnown getKnown() {
 
  187     String getComment() {
 
  196     AbstractFile getAbstractFile() throws EamDbException {
 
  197         if (originalAbstractFile == null) {
 
  198             throw new EamDbException(
"AbstractFile is null");
 
  200         return originalAbstractFile;
 
  209     CorrelationAttributeInstance getCorrelationAttributeInstance() throws EamDbException {
 
  210         if (originalCorrelationInstance == null) {
 
  211             throw new EamDbException(
"CorrelationAttributeInstance is null");
 
  213         return originalCorrelationInstance;