diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/FileTypes.java b/Core/src/org/sleuthkit/autopsy/datamodel/FileTypes.java index 331c72ee206..8ea8c7ea080 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/FileTypes.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/FileTypes.java @@ -397,8 +397,8 @@ public BlackboardArtifact newArtifact(BlackboardArtifact.ARTIFACT_TYPE type) thr } @Override - public DataArtifact newDataArtifact(BlackboardArtifact.Type artifactType, Collection attributesList, OsAccount osAccount) throws TskCoreException { - return content.newDataArtifact(artifactType, attributesList, osAccount); + public DataArtifact newDataArtifact(BlackboardArtifact.Type artifactType, Collection attributesList, Long osAccountId) throws TskCoreException { + return content.newDataArtifact(artifactType, attributesList, osAccountId); } @Override diff --git a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/ChromeCacheExtractor.java b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/ChromeCacheExtractor.java index 1acfc4f2538..292d0b9fa0a 100644 --- a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/ChromeCacheExtractor.java +++ b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/ChromeCacheExtractor.java @@ -540,12 +540,7 @@ private void addArtifacts(CacheEntry cacheEntry, AbstractFile cacheEntryFile, Ab webAttr.add(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PATH_ID, moduleName, cachedItemFile.getId())); - Optional optional = cacheEntryFile.getOsAccountObjectId(); - OsAccount account = null; - if(optional.isPresent()) { - account = currentCase.getSleuthkitCase().getOsAccountManager().getOsAccountByObjectId(optional.get()); - } - BlackboardArtifact webCacheArtifact = cacheEntryFile.newDataArtifact(new BlackboardArtifact.Type(ARTIFACT_TYPE.TSK_WEB_CACHE), webAttr, account); + BlackboardArtifact webCacheArtifact = cacheEntryFile.newDataArtifact(new BlackboardArtifact.Type(ARTIFACT_TYPE.TSK_WEB_CACHE), webAttr); artifactsAdded.add(webCacheArtifact); // Create a TSK_ASSOCIATED_OBJECT on the f_XXX or derived file file back to the CACHE entry diff --git a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/Extract.java b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/Extract.java index 59457120186..53acbc08657 100644 --- a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/Extract.java +++ b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/Extract.java @@ -159,9 +159,10 @@ BlackboardArtifact createArtifactWithAttributes(BlackboardArtifact.ARTIFACT_TYPE * @throws TskCoreException */ BlackboardArtifact createArtifactWithAttributes(BlackboardArtifact.Type type, Content content, Collection attributes) throws TskCoreException { - Optional optional = getOsAccount(content); - if (optional.isPresent() && type.getCategory() == BlackboardArtifact.Category.DATA_ARTIFACT) { - return content.newDataArtifact(type, attributes, optional.get()); + if (type.getCategory() == BlackboardArtifact.Category.DATA_ARTIFACT) { + return (content instanceof AbstractFile) + ? ((AbstractFile) content).newDataArtifact(type, attributes) + : content.newDataArtifact(type, attributes, null); } else { BlackboardArtifact bbart = content.newArtifact(type.getTypeID()); bbart.addAttributes(attributes); @@ -537,28 +538,4 @@ protected File createTemporaryFile(IngestJobContext context, AbstractFile file, return tempFile; } - - /** - * Return the appropriate OsAccount for the given file. - * - * @param file - * - * @return An Optional OsACcount object. - * - * @throws TskCoreException - */ - Optional getOsAccount(Content content) throws TskCoreException { - if(content instanceof AbstractFile) { - if(osAccountCache == null) { - Optional accountId = ((AbstractFile)content).getOsAccountObjectId(); - if(accountId.isPresent()) { - return Optional.ofNullable(tskCase.getOsAccountManager().getOsAccountByObjectId(accountId.get())); - } - return Optional.empty(); - } - - return osAccountCache.getOsAccount(((AbstractFile)content)); - } - return Optional.empty(); - } }