mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-19 11:07:43 +00:00
Merge pull request #6868 from kellykelly3/7495-ra-exception
7495 - Fixed custom artifact RA issue
This commit is contained in:
commit
0e8d563846
@ -143,11 +143,27 @@ abstract class Extract {
|
|||||||
* @return The newly created artifact.
|
* @return The newly created artifact.
|
||||||
*/
|
*/
|
||||||
BlackboardArtifact createArtifactWithAttributes(BlackboardArtifact.ARTIFACT_TYPE type, Content content, Collection<BlackboardAttribute> attributes) throws TskCoreException {
|
BlackboardArtifact createArtifactWithAttributes(BlackboardArtifact.ARTIFACT_TYPE type, Content content, Collection<BlackboardAttribute> attributes) throws TskCoreException {
|
||||||
Optional<OsAccount> optional = getOsAccount(content);
|
return createArtifactWithAttributes(new BlackboardArtifact.Type(type), content, attributes);
|
||||||
if (optional.isPresent() && type.getCategory() == BlackboardArtifact.Category.DATA_ARTIFACT) {
|
}
|
||||||
return content.newDataArtifact(new BlackboardArtifact.Type(type), attributes, optional.get());
|
|
||||||
|
/**
|
||||||
|
* Generic method for creating artifacts.
|
||||||
|
*
|
||||||
|
* @param type The type of artifact.
|
||||||
|
* @param content The file the artifact originated from.
|
||||||
|
* @param attributes A list of the attributes to associate with the
|
||||||
|
* artifact.
|
||||||
|
*
|
||||||
|
* @return The newly created artifact.
|
||||||
|
*
|
||||||
|
* @throws TskCoreException
|
||||||
|
*/
|
||||||
|
BlackboardArtifact createArtifactWithAttributes(BlackboardArtifact.Type type, Content content, Collection<BlackboardAttribute> attributes) throws TskCoreException {
|
||||||
|
Optional<OsAccount> optional = getOsAccount(content);
|
||||||
|
if (optional.isPresent() && type.getCategory() == BlackboardArtifact.Category.DATA_ARTIFACT) {
|
||||||
|
return content.newDataArtifact(type, attributes, optional.get());
|
||||||
} else {
|
} else {
|
||||||
BlackboardArtifact bbart = content.newArtifact(type);
|
BlackboardArtifact bbart = content.newArtifact(type.getTypeID());
|
||||||
bbart.addAttributes(attributes);
|
bbart.addAttributes(attributes);
|
||||||
return bbart;
|
return bbart;
|
||||||
}
|
}
|
||||||
|
@ -441,7 +441,7 @@ final class ExtractRecycleBin extends Extract {
|
|||||||
attributes.add(new BlackboardAttribute(TSK_PATH, getName(), fileName));
|
attributes.add(new BlackboardAttribute(TSK_PATH, getName(), fileName));
|
||||||
attributes.add(new BlackboardAttribute(TSK_DATETIME_DELETED, getName(), dateTime));
|
attributes.add(new BlackboardAttribute(TSK_DATETIME_DELETED, getName(), dateTime));
|
||||||
attributes.add(new BlackboardAttribute(TSK_USER_NAME, getName(), userName == null || userName.isEmpty() ? "" : userName));
|
attributes.add(new BlackboardAttribute(TSK_USER_NAME, getName(), userName == null || userName.isEmpty() ? "" : userName));
|
||||||
return createArtifactWithAttributes(BlackboardArtifact.ARTIFACT_TYPE.fromID(type.getTypeID()), rFile, attributes);
|
return createArtifactWithAttributes(type, rFile, attributes);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1751,7 +1751,6 @@ class ExtractRegistry extends Extract {
|
|||||||
try {
|
try {
|
||||||
for (ShellBag bag : shellbags) {
|
for (ShellBag bag : shellbags) {
|
||||||
Collection<BlackboardAttribute> attributes = new ArrayList<>();
|
Collection<BlackboardAttribute> attributes = new ArrayList<>();
|
||||||
BlackboardArtifact artifact = regFile.newArtifact(getShellBagArtifact().getTypeID());
|
|
||||||
attributes.add(new BlackboardAttribute(TSK_PATH, getName(), bag.getResource()));
|
attributes.add(new BlackboardAttribute(TSK_PATH, getName(), bag.getResource()));
|
||||||
attributes.add(new BlackboardAttribute(getKeyAttribute(), getName(), bag.getKey()));
|
attributes.add(new BlackboardAttribute(getKeyAttribute(), getName(), bag.getKey()));
|
||||||
|
|
||||||
@ -1776,9 +1775,7 @@ class ExtractRegistry extends Extract {
|
|||||||
attributes.add(new BlackboardAttribute(TSK_DATETIME_ACCESSED, getName(), time));
|
attributes.add(new BlackboardAttribute(TSK_DATETIME_ACCESSED, getName(), time));
|
||||||
}
|
}
|
||||||
|
|
||||||
artifact.addAttributes(attributes);
|
artifacts.add(createArtifactWithAttributes(getShellBagArtifact(), regFile, attributes));
|
||||||
|
|
||||||
artifacts.add(artifact);
|
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
if(!context.dataSourceIngestIsCancelled()) {
|
if(!context.dataSourceIngestIsCancelled()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user