From 639fea7717cccd600701814a289c69f34c578c01 Mon Sep 17 00:00:00 2001 From: Richard Cordovano <rcordovano@basistech.com> Date: Fri, 29 Oct 2021 12:22:24 -0400 Subject: [PATCH] 7673 Allow helpers to call correct Blackboard.postArtifacts() API --- .../blackboardutils/ArtifactHelperBase.java | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/bindings/java/src/org/sleuthkit/datamodel/blackboardutils/ArtifactHelperBase.java b/bindings/java/src/org/sleuthkit/datamodel/blackboardutils/ArtifactHelperBase.java index 07e3f3433..06e8a9a9b 100644 --- a/bindings/java/src/org/sleuthkit/datamodel/blackboardutils/ArtifactHelperBase.java +++ b/bindings/java/src/org/sleuthkit/datamodel/blackboardutils/ArtifactHelperBase.java @@ -89,14 +89,13 @@ Optional<Long> getIngestJobId() { } /** - * Creates and adds a string-valued attribute of a specified type to the - * given list, if the attribute value is not empty or null. + * Creates an attribute of a specified type with a string value and adds it + * to a given list of attributes. * * @param attributeType The attribute type. * @param attrValue The attribute value, may not be the empty string or * null. - * @param attributes The list of attributes to which the new attribute - * will be added. + * @param attributes The list of attributes. */ void addAttributeIfNotNull(BlackboardAttribute.ATTRIBUTE_TYPE attributeType, String attrValue, Collection<BlackboardAttribute> attributes) { if (!StringUtils.isEmpty(attrValue)) { @@ -105,13 +104,12 @@ void addAttributeIfNotNull(BlackboardAttribute.ATTRIBUTE_TYPE attributeType, Str } /** - * Creates and adds a long-valued attribute of a specified type to the given - * list, if the attribute value is greater than zero. + * Creates an attribute of a specified type with a long value and adds it to + * a given list of attributes. * * @param attributeType The attribute type. * @param attrValue The attribute value, must be greater than zero. - * @param attributes The list of attributes to which the new attribute - * will be added. + * @param attributes The list of attributes. */ void addAttributeIfNotZero(BlackboardAttribute.ATTRIBUTE_TYPE attributeType, long attrValue, Collection<BlackboardAttribute> attributes) { if (attrValue > 0) { @@ -120,8 +118,8 @@ void addAttributeIfNotZero(BlackboardAttribute.ATTRIBUTE_TYPE attributeType, lon } /** - * Creates and adds an integer-valued attribute of a specified type to the - * given list, if the attribute value is greater than zero. + * Creates an attribute of a specified type with an integer value and adds + * it to a given list of attributes. * * @param attributeType The attribute type. * @param attrValue The attribute value, must be greater than zero. @@ -133,4 +131,5 @@ void addAttributeIfNotZero(BlackboardAttribute.ATTRIBUTE_TYPE attributeType, int attributes.add(new BlackboardAttribute(attributeType, getModuleName(), attrValue)); } } + } -- GitLab