Skip to content
Snippets Groups Projects
Commit 1d40ecd9 authored by Sean-M's avatar Sean-M
Browse files

Merge remote-tracking branch 'upstream/master'

Conflicts:
	bindings/java/nbproject/project.xml
parents 00b5dad6 b80ac2e7
No related branches found
No related tags found
No related merge requests found
<<<<<<< HEAD
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1"> <project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.ant.freeform</type> <type>org.netbeans.modules.ant.freeform</type>
...@@ -153,3 +154,160 @@ ...@@ -153,3 +154,160 @@
</preferences> </preferences>
</configuration> </configuration>
</project> </project>
=======
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.ant.freeform</type>
<configuration>
<general-data xmlns="http://www.netbeans.org/ns/freeform-project/1">
<name>DataModel</name>
</general-data>
<general-data xmlns="http://www.netbeans.org/ns/freeform-project/2">
<!-- Do not use Project Properties customizer when editing this file manually. -->
<name>DataModel</name>
<properties/>
<folders>
<source-folder>
<label>DataModel</label>
<location>.</location>
<encoding>windows-1252</encoding>
</source-folder>
<source-folder>
<label>src</label>
<type>java</type>
<location>src</location>
<encoding>windows-1252</encoding>
</source-folder>
<source-folder>
<label>test</label>
<type>java</type>
<location>test</location>
<encoding>windows-1252</encoding>
</source-folder>
</folders>
<ide-actions>
<action name="build">
<target>dist</target>
</action>
<action name="clean">
<target>clean</target>
</action>
<action name="rebuild">
<target>clean</target>
<target>dist</target>
</action>
<action name="run.single">
<script>nbproject/ide-file-targets.xml</script>
<target>run-selected-file-in-test</target>
<context>
<property>run.class</property>
<folder>test</folder>
<pattern>\.java$</pattern>
<format>java-name</format>
<arity>
<one-file-only/>
</arity>
</context>
</action>
<action name="compile.single">
<script>nbproject/ide-file-targets.xml</script>
<target>compile-selected-files-in-test</target>
<context>
<property>files</property>
<folder>test</folder>
<pattern>\.java$</pattern>
<format>relative-path</format>
<arity>
<separated-files>,</separated-files>
</arity>
</context>
</action>
<action name="test">
<target>test</target>
</action>
<action name="javadoc">
<target>javadoc</target>
</action>
</ide-actions>
<export>
<type>folder</type>
<location>build</location>
<build-target>dist</build-target>
</export>
<export>
<type>folder</type>
<location>build</location>
<build-target>dist</build-target>
</export>
<export>
<type>folder</type>
<location>test</location>
<build-target>dist</build-target>
</export>
<view>
<items>
<source-folder style="packages">
<label>src</label>
<location>src</location>
</source-folder>
<source-folder style="packages">
<label>test</label>
<location>test</location>
</source-folder>
<source-file>
<location>build.xml</location>
</source-file>
</items>
<context-menu>
<ide-action name="build"/>
<ide-action name="rebuild"/>
<ide-action name="clean"/>
<ide-action name="javadoc"/>
<ide-action name="test"/>
</context-menu>
</view>
<subprojects/>
</general-data>
<java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/3">
<compilation-unit>
<package-root>src</package-root>
<classpath mode="compile">lib;lib/diffutils-1.2.1.jar;lib/sqlite-jdbc-3.7.8-SNAPSHOT.jar;lib/junit-4.8.2.jar</classpath>
<built-to>build</built-to>
<source-level>1.7</source-level>
</compilation-unit>
<compilation-unit>
<package-root>test</package-root>
<unit-tests/>
<classpath mode="compile">build;lib/diffutils-1.2.1.jar;lib/diffutils-1.2.1-javadoc.jar;lib/diffutils-1.2.1-sources.jar;lib/junit-4.8.2.jar</classpath>
<built-to>build</built-to>
<built-to>test</built-to>
<source-level>1.7</source-level>
</compilation-unit>
</java-data>
<preferences xmlns="http://www.netbeans.org/ns/auxiliary-configuration-preferences/1">
<module name="org-netbeans-modules-html-editor-lib"/>
<module name="org-netbeans-modules-editor-indent">
<node name="CodeStyle">
<property name="usedProfile" value="project"/>
<node name="project">
<property name="spaces-per-tab" value="4"/>
<property name="tab-size" value="4"/>
<property name="indent-shift-width" value="4"/>
<property name="expand-tabs" value="false"/>
<property name="text-limit-width" value="80"/>
<property name="text-line-wrap" value="none"/>
</node>
</node>
<node name="text">
<node name="x-java">
<node name="CodeStyle">
<node name="project"/>
</node>
</node>
</node>
</module>
<module name="org-netbeans-modules-projectimport-eclipse-core"/>
</preferences>
</configuration>
</project>
>>>>>>> upstream/master
...@@ -18,12 +18,11 @@ ...@@ -18,12 +18,11 @@
*/ */
package org.sleuthkit.datamodel; package org.sleuthkit.datamodel;
/** /**
* Represents an attribute as stored in the Blackboard. Attributes are a name value * Represents an attribute as stored in the Blackboard. Attributes are a name
* pair. The name represents the type of data being stored. Attributes are grouped * value pair. The name represents the type of data being stored. Attributes are
* together into an Artifact as represented by a BlackboardArtifact object. * grouped together into an Artifact as represented by a BlackboardArtifact
* This class is used to create attribute on the blackboard and is used * object. This class is used to create attribute on the blackboard and is used
* to represent attribute queried from the blackboard. * to represent attribute queried from the blackboard.
*/ */
public class BlackboardAttribute { public class BlackboardAttribute {
...@@ -74,6 +73,7 @@ public String getLabel() { ...@@ -74,6 +73,7 @@ public String getLabel() {
/** /**
* Get the enum type for the given type id * Get the enum type for the given type id
*
* @param type type id * @param type type id
* @return enum type * @return enum type
*/ */
...@@ -88,9 +88,10 @@ static public TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE fromType(long type) { ...@@ -88,9 +88,10 @@ static public TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE fromType(long type) {
} }
/** /**
* Standard attribute types. Refer to the C++ code for the full * Standard attribute types. Refer to the C++ code for the full description
* description of their intended use. See http://wiki.sleuthkit.org/index.php?title=Artifact_Examples * of their intended use. See
* for more information. * http://wiki.sleuthkit.org/index.php?title=Artifact_Examples for more
* information.
*/ */
public enum ATTRIBUTE_TYPE { public enum ATTRIBUTE_TYPE {
/* It is very important that this list be kept up to /* It is very important that this list be kept up to
...@@ -136,15 +137,15 @@ public enum ATTRIBUTE_TYPE { ...@@ -136,15 +137,15 @@ public enum ATTRIBUTE_TYPE {
TSK_ENCRYPTION_DETECTED(38, "TSK_ENCRYPTION_DETECTED", "Encryption Detected"), TSK_ENCRYPTION_DETECTED(38, "TSK_ENCRYPTION_DETECTED", "Encryption Detected"),
TSK_MALWARE_DETECTED(39, "TSK_MALWARE_DETECTED", "Malware Detected"), TSK_MALWARE_DETECTED(39, "TSK_MALWARE_DETECTED", "Malware Detected"),
TSK_STEG_DETECTED(40, "TSK_STEG_DETECTED", "Steganography Detected"), TSK_STEG_DETECTED(40, "TSK_STEG_DETECTED", "Steganography Detected"),
TSK_EMAIL_TO(41,"TSK_EMAIL_TO","E-Mail To"), TSK_EMAIL_TO(41, "TSK_EMAIL_TO", "E-Mail To"),
TSK_EMAIL_CC(42,"TSK_EMAIL_CC","E-Mail CC"), TSK_EMAIL_CC(42, "TSK_EMAIL_CC", "E-Mail CC"),
TSK_EMAIL_BCC(43,"TSK_EMAIL_BCC","E-Mail BCC"), TSK_EMAIL_BCC(43, "TSK_EMAIL_BCC", "E-Mail BCC"),
TSK_EMAIL_FROM(44,"TSK_EMAIL_FROM","E-Mail From"), TSK_EMAIL_FROM(44, "TSK_EMAIL_FROM", "E-Mail From"),
TSK_EMAIL_CONTENT_PLAIN(45, "TSK_EMAIL_CONTENT_PLAIN", "Message (Plaintext)"), TSK_EMAIL_CONTENT_PLAIN(45, "TSK_EMAIL_CONTENT_PLAIN", "Message (Plaintext)"),
TSK_EMAIL_CONTENT_HTML(46, "TSK_EMAIL_CONTENT_HTML", "Message (HTML)"), TSK_EMAIL_CONTENT_HTML(46, "TSK_EMAIL_CONTENT_HTML", "Message (HTML)"),
TSK_EMAIL_CONTENT_RTF(47, "TSK_EMAIL_CONTENT_RTF", "Message (RTF)"), TSK_EMAIL_CONTENT_RTF(47, "TSK_EMAIL_CONTENT_RTF", "Message (RTF)"),
TSK_MSG_ID(48,"TSK_MSG_ID","Message ID"), TSK_MSG_ID(48, "TSK_MSG_ID", "Message ID"),
TSK_MSG_REPLY_ID(49,"TSK_MSG_REPLY_ID","Message Reply ID"), TSK_MSG_REPLY_ID(49, "TSK_MSG_REPLY_ID", "Message Reply ID"),
TSK_DATETIME_RCVD(50, "TSK_DATETIME_RCVD", "Date Received"), TSK_DATETIME_RCVD(50, "TSK_DATETIME_RCVD", "Date Received"),
TSK_DATETIME_SENT(51, "TSK_DATETIME_SENT", "Date Sent"), TSK_DATETIME_SENT(51, "TSK_DATETIME_SENT", "Date Sent"),
TSK_SUBJECT(52, "TSK_SUBJECT", "Subject"), TSK_SUBJECT(52, "TSK_SUBJECT", "Subject"),
...@@ -168,10 +169,7 @@ public enum ATTRIBUTE_TYPE { ...@@ -168,10 +169,7 @@ public enum ATTRIBUTE_TYPE {
TSK_PROCESSOR_ARCHITECTURE(70, "TSK_PROCESSOR_ARCHITECTURE", "Processor Architecture"), TSK_PROCESSOR_ARCHITECTURE(70, "TSK_PROCESSOR_ARCHITECTURE", "Processor Architecture"),
TSK_VERSION(71, "TSK_VERSION", "Version"), TSK_VERSION(71, "TSK_VERSION", "Version"),
; ;
/* SEE ABOVE -- ALSO ADD TO C++ CODE */ /* SEE ABOVE -- ALSO ADD TO C++ CODE */
private String label; private String label;
private int typeID; private int typeID;
private String displayName; private String displayName;
...@@ -184,7 +182,7 @@ private ATTRIBUTE_TYPE(int typeID, String label, String displayName) { ...@@ -184,7 +182,7 @@ private ATTRIBUTE_TYPE(int typeID, String label, String displayName) {
/** /**
* Get label string of this attribute * Get label string of this attribute
* *
* @return label string * @return label string
*/ */
public String getLabel() { public String getLabel() {
...@@ -193,7 +191,7 @@ public String getLabel() { ...@@ -193,7 +191,7 @@ public String getLabel() {
/** /**
* Get type id of this attribute * Get type id of this attribute
* *
* @return type id * @return type id
*/ */
public int getTypeID() { public int getTypeID() {
...@@ -202,7 +200,7 @@ public int getTypeID() { ...@@ -202,7 +200,7 @@ public int getTypeID() {
/** /**
* Get the attribute enum for the given label * Get the attribute enum for the given label
* *
* @param label label string * @param label label string
* @return the enum value * @return the enum value
*/ */
...@@ -214,15 +212,17 @@ static public ATTRIBUTE_TYPE fromLabel(String label) { ...@@ -214,15 +212,17 @@ static public ATTRIBUTE_TYPE fromLabel(String label) {
} }
throw new IllegalArgumentException("No ATTRIBUTE_TYPE matching type: " + label); throw new IllegalArgumentException("No ATTRIBUTE_TYPE matching type: " + label);
} }
public String getDisplayName() { public String getDisplayName() {
return this.displayName; return this.displayName;
} }
} }
/** /**
* Constructor for a blackboard attribute. Should only be used by SleuthkitCase * Constructor for a blackboard attribute.
* *
* Should only be used by SleuthkitCase
*
* @param artifactID artifact id for this attribute * @param artifactID artifact id for this attribute
* @param attributeTypeID type id * @param attributeTypeID type id
* @param moduleName module that created this attribute * @param moduleName module that created this attribute
...@@ -233,7 +233,8 @@ public String getDisplayName() { ...@@ -233,7 +233,8 @@ public String getDisplayName() {
* @param valueDouble value if it is a double * @param valueDouble value if it is a double
* @param valueString value if it is a string * @param valueString value if it is a string
* @param valueBytes value if it is a byte array * @param valueBytes value if it is a byte array
* @param Case the case that can be used to make calls into the blackboard db * @param Case the case that can be used to make calls into the blackboard
* db
*/ */
protected BlackboardAttribute(long artifactID, int attributeTypeID, String moduleName, String context, protected BlackboardAttribute(long artifactID, int attributeTypeID, String moduleName, String context,
TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE valueType, int valueInt, long valueLong, double valueDouble, TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE valueType, int valueInt, long valueLong, double valueDouble,
...@@ -247,14 +248,23 @@ protected BlackboardAttribute(long artifactID, int attributeTypeID, String modul ...@@ -247,14 +248,23 @@ protected BlackboardAttribute(long artifactID, int attributeTypeID, String modul
this.valueInt = valueInt; this.valueInt = valueInt;
this.valueLong = valueLong; this.valueLong = valueLong;
this.valueDouble = valueDouble; this.valueDouble = valueDouble;
this.valueString = valueString; if (valueString == null) {
this.valueBytes = valueBytes; this.valueString = "";
} else {
this.valueString = valueString;
}
if (valueBytes == null) {
this.valueBytes = new byte[0];
} else {
this.valueBytes = valueBytes;
}
this.Case = Case; this.Case = Case;
} }
/** /**
* Create a blackboard attribute that stores an int (creates an attribute that can be * Create a blackboard attribute that stores an int (creates an attribute
* added to an artifact) * that can be added to an artifact)
*
* @param attributeTypeID type of the attribute * @param attributeTypeID type of the attribute
* @param moduleName name of the module that is creating the attribute * @param moduleName name of the module that is creating the attribute
* @param valueInt the value * @param valueInt the value
...@@ -273,24 +283,27 @@ public BlackboardAttribute(int attributeTypeID, String moduleName, int valueInt) ...@@ -273,24 +283,27 @@ public BlackboardAttribute(int attributeTypeID, String moduleName, int valueInt)
} }
/** /**
* Create a blackboard attribute that stores an int (creates an attribute that can be * Create a blackboard attribute that stores an int (creates an attribute
* added to an artifact) * that can be added to an artifact)
*
* @param attributeTypeID type of the attribute * @param attributeTypeID type of the attribute
* @param moduleName name of the module that is creating the attribute * @param moduleName name of the module that is creating the attribute
* @param context extra information about the attribute * @param context extra information about the attribute
* @param valueInt the value * @param valueInt the value
* @Deprecated context parameter will be deprecated - in lieu of specific blackboard attributes * @deprecated context parameter will be deprecated - in lieu of specific
* use the alternative constructor without context * blackboard attributes use the alternative constructor without context
*/ */
@Deprecated
public BlackboardAttribute(int attributeTypeID, String moduleName, String context, public BlackboardAttribute(int attributeTypeID, String moduleName, String context,
int valueInt) { int valueInt) {
this(attributeTypeID, moduleName, valueInt); this(attributeTypeID, moduleName, valueInt);
this.context = context; this.context = context;
} }
/** /**
* Create a blackboard attribute that stores a long (creates an attribute that can be * Create a blackboard attribute that stores a long (creates an attribute
* added to an artifact) * that can be added to an artifact)
*
* @param attributeTypeID type of the attribute * @param attributeTypeID type of the attribute
* @param moduleName name of the module that is creating the attribute * @param moduleName name of the module that is creating the attribute
* @param valueLong the value * @param valueLong the value
...@@ -311,15 +324,17 @@ public BlackboardAttribute(int attributeTypeID, String moduleName, ...@@ -311,15 +324,17 @@ public BlackboardAttribute(int attributeTypeID, String moduleName,
} }
/** /**
* Create a blackboard attribute that stores a long (creates an attribute that can be * Create a blackboard attribute that stores a long (creates an attribute
* added to an artifact) * that can be added to an artifact)
*
* @param attributeTypeID type of the attribute * @param attributeTypeID type of the attribute
* @param moduleName name of the module that is creating the attribute * @param moduleName name of the module that is creating the attribute
* @param context extra information about the attribute * @param context extra information about the attribute
* @param valueLong the value * @param valueLong the value
* @Deprecated context parameter will be deprecated - in lieu of specific blackboard attributes * @deprecated context parameter will be deprecated - in lieu of specific
* use the alternative constructor without context * blackboard attributes use the alternative constructor without context
*/ */
@Deprecated
public BlackboardAttribute(int attributeTypeID, String moduleName, String context, public BlackboardAttribute(int attributeTypeID, String moduleName, String context,
long valueLong) { long valueLong) {
this(attributeTypeID, moduleName, valueLong); this(attributeTypeID, moduleName, valueLong);
...@@ -327,14 +342,15 @@ public BlackboardAttribute(int attributeTypeID, String moduleName, String contex ...@@ -327,14 +342,15 @@ public BlackboardAttribute(int attributeTypeID, String moduleName, String contex
} }
/** /**
* Create a blackboard attribute that stores a double (creates an attribute that can be * Create a blackboard attribute that stores a double (creates an attribute
* added to an artifact) * that can be added to an artifact)
*
* @param attributeTypeID type of the attribute * @param attributeTypeID type of the attribute
* @param moduleName name of the module that is creating the attribute * @param moduleName name of the module that is creating the attribute
* @param context extra information about the attribute * @param context extra information about the attribute
* @param valueDouble the value * @param valueDouble the value
*/ */
public BlackboardAttribute(int attributeTypeID, String moduleName, public BlackboardAttribute(int attributeTypeID, String moduleName,
double valueDouble) { double valueDouble) {
this.artifactID = 0; this.artifactID = 0;
this.attributeTypeID = attributeTypeID; this.attributeTypeID = attributeTypeID;
...@@ -347,17 +363,19 @@ public BlackboardAttribute(int attributeTypeID, String moduleName, ...@@ -347,17 +363,19 @@ public BlackboardAttribute(int attributeTypeID, String moduleName,
this.valueBytes = new byte[0]; this.valueBytes = new byte[0];
this.context = ""; this.context = "";
} }
/** /**
* Create a blackboard attribute that stores a double (creates an attribute that can be * Create a blackboard attribute that stores a double (creates an attribute
* added to an artifact) * that can be added to an artifact)
*
* @param attributeTypeID type of the attribute * @param attributeTypeID type of the attribute
* @param moduleName name of the module that is creating the attribute * @param moduleName name of the module that is creating the attribute
* @param context extra information about the attribute * @param context extra information about the attribute
* @param valueDouble the value * @param valueDouble the value
* @Deprecated context parameter will be deprecated - in lieu of specific blackboard attributes * @deprecated context parameter will be deprecated - in lieu of specific
* use the alternative constructor without context * blackboard attributes use the alternative constructor without context
*/ */
@Deprecated
public BlackboardAttribute(int attributeTypeID, String moduleName, String context, public BlackboardAttribute(int attributeTypeID, String moduleName, String context,
double valueDouble) { double valueDouble) {
this(attributeTypeID, moduleName, valueDouble); this(attributeTypeID, moduleName, valueDouble);
...@@ -365,8 +383,9 @@ public BlackboardAttribute(int attributeTypeID, String moduleName, String contex ...@@ -365,8 +383,9 @@ public BlackboardAttribute(int attributeTypeID, String moduleName, String contex
} }
/** /**
* Create a blackboard attribute that stores a string (creates an attribute that can be * Create a blackboard attribute that stores a string (creates an attribute
* added to an artifact) * that can be added to an artifact)
*
* @param attributeTypeID type of the attribute * @param attributeTypeID type of the attribute
* @param moduleName name of the module that is creating the attribute * @param moduleName name of the module that is creating the attribute
* @param valueString the value * @param valueString the value
...@@ -379,27 +398,61 @@ public BlackboardAttribute(int attributeTypeID, String moduleName, String valueS ...@@ -379,27 +398,61 @@ public BlackboardAttribute(int attributeTypeID, String moduleName, String valueS
this.valueInt = 0; this.valueInt = 0;
this.valueLong = 0; this.valueLong = 0;
this.valueDouble = 0; this.valueDouble = 0;
this.valueString = valueString; if (valueString == null) {
this.valueString = "";
} else {
this.valueString = valueString;
}
this.valueBytes = new byte[0]; this.valueBytes = new byte[0];
this.context = ""; this.context = "";
} }
/** /**
* Create a blackboard attribute that stores a string (creates an attribute that can be * Create a blackboard attribute that stores a string (creates an attribute
* added to an artifact) * that can be added to an artifact)
*
* @param attributeTypeID type of the attribute * @param attributeTypeID type of the attribute
* @param moduleName name of the module that is creating the attribute * @param moduleName name of the module that is creating the attribute
* @param context extra information about the attribute * @param context extra information about the attribute
* @param valueString the value * @param valueString the value
* @Deprecated context parameter will be deprecated - in lieu of specific blackboard attributes * @deprecated context parameter will be deprecated - in lieu of specific
* use the alternative constructor without context * blackboard attributes use the alternative constructor without context
*/ */
@Deprecated
public BlackboardAttribute(int attributeTypeID, String moduleName, String context, public BlackboardAttribute(int attributeTypeID, String moduleName, String context,
String valueString) { String valueString) {
this(attributeTypeID, moduleName, valueString); this(attributeTypeID, moduleName, valueString);
this.context = context; this.context = context;
} }
/**
* Create a blackboard attribute that stores a byte array (creates an
* attribute that can be added to an artifact)
*
* @param attributeTypeID type of the attribute
* @param moduleName name of the module that is creating the attribute
* @param context extra information about the attribute
* @param valueBytes the value
*/
public BlackboardAttribute(int attributeTypeID, String moduleName, String context,
byte[] valueBytes) {
this.artifactID = 0;
this.attributeTypeID = attributeTypeID;
this.moduleName = moduleName;
this.context = context;
this.valueType = TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.BYTE;
this.valueInt = 0;
this.valueLong = 0;
this.valueDouble = 0;
this.valueString = "";
if (valueBytes == null) {
this.valueBytes = new byte[0];
} else {
this.valueBytes = valueBytes;
}
}
@Override @Override
public int hashCode() { public int hashCode() {
int hash = 5; int hash = 5;
...@@ -426,34 +479,10 @@ public boolean equals(Object obj) { ...@@ -426,34 +479,10 @@ public boolean equals(Object obj) {
public String toString() { public String toString() {
return "BlackboardAttribute{" + "artifactID=" + artifactID + ", attributeTypeID=" + attributeTypeID + ", moduleName=" + moduleName + ", context=" + context + ", valueType=" + valueType + ", valueInt=" + valueInt + ", valueLong=" + valueLong + ", valueDouble=" + valueDouble + ", valueString=" + valueString + ", valueBytes=" + valueBytes + ", Case=" + Case + '}'; return "BlackboardAttribute{" + "artifactID=" + artifactID + ", attributeTypeID=" + attributeTypeID + ", moduleName=" + moduleName + ", context=" + context + ", valueType=" + valueType + ", valueInt=" + valueInt + ", valueLong=" + valueLong + ", valueDouble=" + valueDouble + ", valueString=" + valueString + ", valueBytes=" + valueBytes + ", Case=" + Case + '}';
} }
/** /**
* Create a blackboard attribute that stores a byte array (creates an attribute that can be * Get the artifact id
* added to an artifact) *
* @param attributeTypeID type of the attribute
* @param moduleName name of the module that is creating the attribute
* @param context extra information about the attribute
* @param valueBytes the value
*/
public BlackboardAttribute(int attributeTypeID, String moduleName, String context,
byte[] valueBytes) {
this.artifactID = 0;
this.attributeTypeID = attributeTypeID;
this.moduleName = moduleName;
this.context = context;
this.valueType = TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.BYTE;
this.valueInt = 0;
this.valueLong = 0;
this.valueDouble = 0;
this.valueString = "";
this.valueBytes = valueBytes;
}
/**
* Get the artifact id
* @return artifact id * @return artifact id
*/ */
public long getArtifactID() { public long getArtifactID() {
...@@ -462,6 +491,7 @@ public long getArtifactID() { ...@@ -462,6 +491,7 @@ public long getArtifactID() {
/** /**
* Get the attribute type id * Get the attribute type id
*
* @return type id * @return type id
*/ */
public int getAttributeTypeID() { public int getAttributeTypeID() {
...@@ -470,6 +500,7 @@ public int getAttributeTypeID() { ...@@ -470,6 +500,7 @@ public int getAttributeTypeID() {
/** /**
* Get the attribute type name string * Get the attribute type name string
*
* @return type name string * @return type name string
*/ */
public String getAttributeTypeName() throws TskCoreException { public String getAttributeTypeName() throws TskCoreException {
...@@ -478,6 +509,7 @@ public String getAttributeTypeName() throws TskCoreException { ...@@ -478,6 +509,7 @@ public String getAttributeTypeName() throws TskCoreException {
/** /**
* Get the attribute type display name * Get the attribute type display name
*
* @return type display name * @return type display name
*/ */
public String getAttributeTypeDisplayName() throws TskCoreException { public String getAttributeTypeDisplayName() throws TskCoreException {
...@@ -485,10 +517,11 @@ public String getAttributeTypeDisplayName() throws TskCoreException { ...@@ -485,10 +517,11 @@ public String getAttributeTypeDisplayName() throws TskCoreException {
} }
/** /**
* Get the value type * Get the value type.
* This should be used to identify the type of value and call
* the right value get method.
* *
* This should be used to identify the type of value and
* call the right value get method.
*
* @return value type * @return value type
*/ */
public TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE getValueType() { public TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE getValueType() {
...@@ -497,7 +530,7 @@ public TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE getValueType() { ...@@ -497,7 +530,7 @@ public TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE getValueType() {
/** /**
* Get the value if it is an int * Get the value if it is an int
* *
* @return value * @return value
*/ */
public int getValueInt() { public int getValueInt() {
...@@ -506,7 +539,7 @@ public int getValueInt() { ...@@ -506,7 +539,7 @@ public int getValueInt() {
/** /**
* Get value if it is a long * Get value if it is a long
* *
* @return value * @return value
*/ */
public long getValueLong() { public long getValueLong() {
...@@ -515,7 +548,7 @@ public long getValueLong() { ...@@ -515,7 +548,7 @@ public long getValueLong() {
/** /**
* Get value if it is a double * Get value if it is a double
* *
* @return value * @return value
*/ */
public double getValueDouble() { public double getValueDouble() {
...@@ -524,7 +557,7 @@ public double getValueDouble() { ...@@ -524,7 +557,7 @@ public double getValueDouble() {
/** /**
* Get value if it is a string * Get value if it is a string
* *
* @return value * @return value
*/ */
public String getValueString() { public String getValueString() {
...@@ -533,7 +566,7 @@ public String getValueString() { ...@@ -533,7 +566,7 @@ public String getValueString() {
/** /**
* Get value if it is a byte array * Get value if it is a byte array
* *
* @return value * @return value
*/ */
public byte[] getValueBytes() { public byte[] getValueBytes() {
...@@ -542,7 +575,7 @@ public byte[] getValueBytes() { ...@@ -542,7 +575,7 @@ public byte[] getValueBytes() {
/** /**
* Get module name of the module that created the attribute * Get module name of the module that created the attribute
* *
* @return name * @return name
*/ */
public String getModuleName() { public String getModuleName() {
...@@ -551,7 +584,7 @@ public String getModuleName() { ...@@ -551,7 +584,7 @@ public String getModuleName() {
/** /**
* Get context of the data stored in the attribute, if set * Get context of the data stored in the attribute, if set
* *
* @return context * @return context
*/ */
public String getContext() { public String getContext() {
...@@ -559,12 +592,15 @@ public String getContext() { ...@@ -559,12 +592,15 @@ public String getContext() {
} }
/** /**
* Get the artifact that this attribute is associated with * Get the artifact that this attribute is associated with.
* The artifact can be used to find the associated file and other attributes
* associated with this artifact.
* *
* The artifact can
* be used to find the associated file and other attributes associated with
* this artifact.
*
* @return artifact * @return artifact
* @throws TskException exception thrown when critical error occurred within tsk core * @throws TskException exception thrown when critical error occurred within
* tsk core
*/ */
public BlackboardArtifact getParentArtifact() throws TskCoreException { public BlackboardArtifact getParentArtifact() throws TskCoreException {
return Case.getBlackboardArtifact(artifactID); return Case.getBlackboardArtifact(artifactID);
...@@ -572,7 +608,7 @@ public BlackboardArtifact getParentArtifact() throws TskCoreException { ...@@ -572,7 +608,7 @@ public BlackboardArtifact getParentArtifact() throws TskCoreException {
/** /**
* Set the artifactID, this should only be used by sleuthkitCase * Set the artifactID, this should only be used by sleuthkitCase
* *
* @param artifactID artifactID to set on a newly created attribute * @param artifactID artifactID to set on a newly created attribute
*/ */
protected void setArtifactID(long artifactID) { protected void setArtifactID(long artifactID) {
...@@ -582,6 +618,7 @@ protected void setArtifactID(long artifactID) { ...@@ -582,6 +618,7 @@ protected void setArtifactID(long artifactID) {
/** /**
* Set the SleuthkitCase handle, this should only be used by SleuthkitCase * Set the SleuthkitCase handle, this should only be used by SleuthkitCase
* on a newly created attribute * on a newly created attribute
*
* @param Case case handle to associated with this attribute * @param Case case handle to associated with this attribute
*/ */
protected void setCase(SleuthkitCase Case) { protected void setCase(SleuthkitCase Case) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment