diff --git a/bindings/java/src/org/sleuthkit/datamodel/blackboardutils/ArtifactHelperBase.java b/bindings/java/src/org/sleuthkit/datamodel/blackboardutils/ArtifactHelperBase.java index 08e287e080a4dd6ea115f3867bec03f02bef81ff..d8505ed5344aab1575f00baf5ef165f36cd5092e 100644 --- a/bindings/java/src/org/sleuthkit/datamodel/blackboardutils/ArtifactHelperBase.java +++ b/bindings/java/src/org/sleuthkit/datamodel/blackboardutils/ArtifactHelperBase.java @@ -20,8 +20,8 @@ import java.util.Collection; import org.apache.commons.lang3.StringUtils; -import org.sleuthkit.datamodel.AbstractFile; import org.sleuthkit.datamodel.BlackboardAttribute; +import org.sleuthkit.datamodel.Content; import org.sleuthkit.datamodel.SleuthkitCase; /** @@ -31,29 +31,29 @@ class ArtifactHelperBase { private final SleuthkitCase caseDb; - private final AbstractFile srcAbstractFile; // artifact source - private final String moduleName; // module creating the artifacts + private final Content srcContent; // artifact source + private final String moduleName; // module creating the artifacts /** * Creates an artifact helper. * * @param caseDb Sleuthkit case db * @param moduleName name module using the helper - * @param srcFile source file + * @param srcContent source content */ - ArtifactHelperBase(SleuthkitCase caseDb, String moduleName, AbstractFile srcFile) { + ArtifactHelperBase(SleuthkitCase caseDb, String moduleName, Content srcContent) { this.moduleName = moduleName; - this.srcAbstractFile = srcFile; + this.srcContent = srcContent; this.caseDb = caseDb; } /** - * Returns the source abstract file. + * Returns the source content. * - * @return Source abstract file. + * @return Source content. */ - AbstractFile getAbstractFile() { - return this.srcAbstractFile; + Content getContent() { + return this.srcContent; } /** diff --git a/bindings/java/src/org/sleuthkit/datamodel/blackboardutils/ArtifactsHelper.java b/bindings/java/src/org/sleuthkit/datamodel/blackboardutils/ArtifactsHelper.java index a8878b295a31c207475ed561107023202beee91b..b8d7ba4a4965950ed89cc790456316692839e348 100644 --- a/bindings/java/src/org/sleuthkit/datamodel/blackboardutils/ArtifactsHelper.java +++ b/bindings/java/src/org/sleuthkit/datamodel/blackboardutils/ArtifactsHelper.java @@ -21,10 +21,10 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Collections; -import org.sleuthkit.datamodel.AbstractFile; import org.sleuthkit.datamodel.Blackboard.BlackboardException; import org.sleuthkit.datamodel.BlackboardArtifact; import org.sleuthkit.datamodel.BlackboardAttribute; +import org.sleuthkit.datamodel.Content; import org.sleuthkit.datamodel.SleuthkitCase; import org.sleuthkit.datamodel.TskCoreException; @@ -39,11 +39,11 @@ public final class ArtifactsHelper extends ArtifactHelperBase { * * @param caseDb Sleuthkit case database. * @param moduleName Name of module using the helper. - * @param srcFile Source file for the artifacts. + * @param srcContent Source content for the artifacts. * */ - public ArtifactsHelper(SleuthkitCase caseDb, String moduleName, AbstractFile srcFile) { - super(caseDb, moduleName, srcFile); + public ArtifactsHelper(SleuthkitCase caseDb, String moduleName, Content srcContent) { + super(caseDb, moduleName, srcContent); } /** @@ -95,7 +95,7 @@ public BlackboardArtifact addGPSLocation(double latitude, double longitude, long Collection<BlackboardAttribute> attributes = new ArrayList<>(); // create artifact - gpsTrackpointArtifact = getAbstractFile().newArtifact(BlackboardArtifact.ARTIFACT_TYPE.TSK_GPS_TRACKPOINT); + gpsTrackpointArtifact = getContent().newArtifact(BlackboardArtifact.ARTIFACT_TYPE.TSK_GPS_TRACKPOINT); // construct attributes attributes.add(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_GEO_LATITUDE, getModuleName(), latitude)); @@ -154,7 +154,7 @@ public BlackboardArtifact addInstalledProgram(String programName, long dateInsta Collection<BlackboardAttribute> attributes = new ArrayList<>(); // create artifact - installedProgramArtifact = getAbstractFile().newArtifact(BlackboardArtifact.ARTIFACT_TYPE.TSK_INSTALLED_PROG); + installedProgramArtifact = getContent().newArtifact(BlackboardArtifact.ARTIFACT_TYPE.TSK_INSTALLED_PROG); // construct attributes attributes.add(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PROG_NAME, getModuleName(), programName)); diff --git a/bindings/java/src/org/sleuthkit/datamodel/blackboardutils/CommunicationArtifactsHelper.java b/bindings/java/src/org/sleuthkit/datamodel/blackboardutils/CommunicationArtifactsHelper.java index 7aefe077260c9d6fc8abc4ddb87fa503131978c7..558bd465ade484c079850d187204dd1b240415dc 100644 --- a/bindings/java/src/org/sleuthkit/datamodel/blackboardutils/CommunicationArtifactsHelper.java +++ b/bindings/java/src/org/sleuthkit/datamodel/blackboardutils/CommunicationArtifactsHelper.java @@ -33,6 +33,7 @@ import org.sleuthkit.datamodel.Blackboard.BlackboardException; import org.sleuthkit.datamodel.BlackboardArtifact; import org.sleuthkit.datamodel.BlackboardAttribute; +import org.sleuthkit.datamodel.Content; import org.sleuthkit.datamodel.DataSource; import org.sleuthkit.datamodel.Relationship; import org.sleuthkit.datamodel.SleuthkitCase; @@ -138,7 +139,7 @@ public String getDisplayName() { * * @param caseDb Sleuthkit case db. * @param moduleName Name of module using the helper. - * @param srcFile Source file being processed by the module. + * @param srcContent Source content being processed by the module. * @param accountsType Account type {@link Account.Type} created by this * module. * @@ -146,13 +147,13 @@ public String getDisplayName() { * account. */ public CommunicationArtifactsHelper(SleuthkitCase caseDb, - String moduleName, AbstractFile srcFile, Account.Type accountsType) throws TskCoreException { + String moduleName, Content srcContent, Account.Type accountsType) throws TskCoreException { - super(caseDb, moduleName, srcFile); + super(caseDb, moduleName, srcContent); this.moduleAccountsType = accountsType; this.selfAccountType = Account.Type.DEVICE; - this.selfAccountId = ((DataSource) getAbstractFile().getDataSource()).getDeviceId(); + this.selfAccountId = ((DataSource) getContent().getDataSource()).getDeviceId(); } /** @@ -166,7 +167,7 @@ public CommunicationArtifactsHelper(SleuthkitCase caseDb, * * @param caseDb Sleuthkit case db. * @param moduleName Name of module using the helper. - * @param srcFile Source file being processed by the module. + * @param srcContent Source content being processed by the module. * @param accountsType Account type {@link Account.Type} created by this * module. * @param selfAccountType Self account type to be created for this module. @@ -174,9 +175,9 @@ public CommunicationArtifactsHelper(SleuthkitCase caseDb, * * @throws TskCoreException If there is an error creating the self account */ - public CommunicationArtifactsHelper(SleuthkitCase caseDb, String moduleName, AbstractFile srcFile, Account.Type accountsType, Account.Type selfAccountType, String selfAccountId) throws TskCoreException { + public CommunicationArtifactsHelper(SleuthkitCase caseDb, String moduleName, Content srcContent, Account.Type accountsType, Account.Type selfAccountType, String selfAccountId) throws TskCoreException { - super(caseDb, moduleName, srcFile); + super(caseDb, moduleName, srcContent); this.moduleAccountsType = accountsType; this.selfAccountType = selfAccountType; @@ -272,7 +273,7 @@ public BlackboardArtifact addContact(String contactName, Collection<BlackboardAttribute> attributes = new ArrayList<>(); // create TSK_CONTACT artifact - contactArtifact = getAbstractFile().newArtifact(ARTIFACT_TYPE.TSK_CONTACT); + contactArtifact = getContent().newArtifact(ARTIFACT_TYPE.TSK_CONTACT); // construct attributes attributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_NAME, getModuleName(), contactName)); @@ -351,7 +352,7 @@ private void createContactMethodAccountAndRelationship(Account.Type accountType, * instance. */ private AccountFileInstance createAccountInstance(Account.Type accountType, String accountUniqueID) throws TskCoreException { - return getSleuthkitCase().getCommunicationsManager().createAccountFileInstance(accountType, accountUniqueID, getModuleName(), getAbstractFile()); + return getSleuthkitCase().getCommunicationsManager().createAccountFileInstance(accountType, accountUniqueID, getModuleName(), getContent()); } /** @@ -497,7 +498,7 @@ public BlackboardArtifact addMessage(String messageType, Collection<BlackboardAttribute> attributes = new ArrayList<>(); // create TSK_MESSAGE artifact - msgArtifact = getAbstractFile().newArtifact(ARTIFACT_TYPE.TSK_MESSAGE); + msgArtifact = getContent().newArtifact(ARTIFACT_TYPE.TSK_MESSAGE); // construct attributes attributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_MESSAGE_TYPE, getModuleName(), messageType)); @@ -694,7 +695,7 @@ public BlackboardArtifact addCalllog(CommunicationDirection direction, Collection<BlackboardAttribute> attributes = new ArrayList<>(); // Create TSK_CALLLOG artifact - callLogArtifact = getAbstractFile().newArtifact(ARTIFACT_TYPE.TSK_CALLLOG); + callLogArtifact = getContent().newArtifact(ARTIFACT_TYPE.TSK_CALLLOG); // Add basic attributes addAttributeIfNotZero(ATTRIBUTE_TYPE.TSK_DATETIME_START, startDateTime, attributes); @@ -877,7 +878,7 @@ private void addMessageReadStatusIfKnown(MessageReadStatus readStatus, Collectio */ private synchronized AccountFileInstance getSelfAccountInstance() throws TskCoreException { if (selfAccountInstance == null) { - selfAccountInstance = getSleuthkitCase().getCommunicationsManager().createAccountFileInstance(selfAccountType, selfAccountId, this.getModuleName(), getAbstractFile()); + selfAccountInstance = getSleuthkitCase().getCommunicationsManager().createAccountFileInstance(selfAccountType, selfAccountId, this.getModuleName(), getContent()); } return selfAccountInstance; } diff --git a/bindings/java/src/org/sleuthkit/datamodel/blackboardutils/WebBrowserArtifactsHelper.java b/bindings/java/src/org/sleuthkit/datamodel/blackboardutils/WebBrowserArtifactsHelper.java index 5eb743af6a792a3d54e4879a725512ecc4ee060b..40e3177e4649aa517609b7f233b608b98235ac64 100644 --- a/bindings/java/src/org/sleuthkit/datamodel/blackboardutils/WebBrowserArtifactsHelper.java +++ b/bindings/java/src/org/sleuthkit/datamodel/blackboardutils/WebBrowserArtifactsHelper.java @@ -29,6 +29,7 @@ import org.sleuthkit.datamodel.Blackboard.BlackboardException; import org.sleuthkit.datamodel.BlackboardArtifact; import org.sleuthkit.datamodel.BlackboardAttribute; +import org.sleuthkit.datamodel.Content; import org.sleuthkit.datamodel.SleuthkitCase; import org.sleuthkit.datamodel.TskCoreException; @@ -46,11 +47,11 @@ public final class WebBrowserArtifactsHelper extends ArtifactHelperBase { * * @param caseDb Sleuthkit case db. * @param moduleName Name of module using the helper. - * @param srcFile Source file being processed by the module. + * @param srcContent Source content being processed by the module. * */ - public WebBrowserArtifactsHelper(SleuthkitCase caseDb, String moduleName, AbstractFile srcFile) { - super(caseDb, moduleName, srcFile); + public WebBrowserArtifactsHelper(SleuthkitCase caseDb, String moduleName, Content srcContent) { + super(caseDb, moduleName, srcContent); } /** @@ -94,7 +95,7 @@ public BlackboardArtifact addWebBookmark(String url, String title, long creation Collection<BlackboardAttribute> attributes = new ArrayList<>(); // create artifact - bookMarkArtifact = getAbstractFile().newArtifact(BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_BOOKMARK); + bookMarkArtifact = getContent().newArtifact(BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_BOOKMARK); // construct attributes attributes.add(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_URL, getModuleName(), url)); @@ -164,7 +165,7 @@ public BlackboardArtifact addWebCookie(String url, Collection<BlackboardAttribute> attributes = new ArrayList<>(); // create artifact - cookieArtifact = getAbstractFile().newArtifact(BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_COOKIE); + cookieArtifact = getContent().newArtifact(BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_COOKIE); // construct attributes attributes.add(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_URL, getModuleName(), url)); @@ -226,7 +227,7 @@ public BlackboardArtifact addWebDownload(String url, long startTime, String path Collection<BlackboardAttribute> attributes = new ArrayList<>(); // reate artifact - webDownloadArtifact = getAbstractFile().newArtifact(BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_DOWNLOAD); + webDownloadArtifact = getContent().newArtifact(BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_DOWNLOAD); // construct attributes attributes.add(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PATH, getModuleName(), path)); @@ -297,7 +298,7 @@ public BlackboardArtifact addWebFormAddress(String personName, String email, Collection<BlackboardAttribute> attributes = new ArrayList<>(); // create artifact - webFormAddressArtifact = getAbstractFile().newArtifact(BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_FORM_ADDRESS); + webFormAddressArtifact = getContent().newArtifact(BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_FORM_ADDRESS); // construct attributes attributes.add(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_NAME, getModuleName(), personName)); @@ -365,7 +366,7 @@ public BlackboardArtifact addWebFormAutofill(String name, String value, Collection<BlackboardAttribute> attributes = new ArrayList<>(); // create artifact - webFormAutofillArtifact = getAbstractFile().newArtifact(BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_FORM_AUTOFILL); + webFormAutofillArtifact = getContent().newArtifact(BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_FORM_AUTOFILL); // construct attributes attributes.add(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_NAME, getModuleName(), name)); @@ -431,7 +432,7 @@ public BlackboardArtifact addWebHistory(String url, long accessTime, Collection<BlackboardAttribute> attributes = new ArrayList<>(); // create artifact - webHistoryArtifact = getAbstractFile().newArtifact(BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_HISTORY); + webHistoryArtifact = getContent().newArtifact(BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_HISTORY); // construct attributes attributes.add(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_URL, getModuleName(), url));