From 98151b1de8791fe3aeb64981a2aa035087fcbb19 Mon Sep 17 00:00:00 2001 From: Kelly Kelly Date: Tue, 21 Apr 2020 17:13:35 -0400 Subject: [PATCH] Updated format in TagNameDefinition --- .../services/TagNameDefinition.java | 58 +++++++++---------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/services/TagNameDefinition.java b/Core/src/org/sleuthkit/autopsy/casemodule/services/TagNameDefinition.java index 750bfbdb00..c3e800b61f 100755 --- a/Core/src/org/sleuthkit/autopsy/casemodule/services/TagNameDefinition.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/services/TagNameDefinition.java @@ -96,11 +96,11 @@ final class TagNameDefinition implements Comparable { this.color = color; this.knownStatus = status; } - + static Collection getStandardTagNameDefinitions() { return STANDARD_TAGS_DEFINITIONS.values(); } - + static Collection getProjectVICDefaultDefinitions() { return PROJECT_VIC_TAG_DEFINITIONS.values(); } @@ -109,7 +109,7 @@ final class TagNameDefinition implements Comparable { List strList = new ArrayList<>(); strList.addAll(STANDARD_TAGS_DEFINITIONS.keySet()); strList.addAll(PROJECT_VIC_TAG_DEFINITIONS.keySet()); - + return strList; } @@ -226,14 +226,14 @@ final class TagNameDefinition implements Comparable { /** * Gets tag name definitions from the tag settings file as well as the * default tag name definitions. - * - * The currently custom tags properties are stored in one string property value - * separated by ;. The properties of an individual tag are comma separated - * in the format of: + * + * The currently custom tags properties are stored in one string property + * value separated by ;. The properties of an individual tag are comma + * separated in the format of: * tag_name,tag_description,tag_color,known_status - * - * In prior versions of autopsy the known_status was stored in the central repository, - * therefore the properties file only had three values. + * + * In prior versions of autopsy the known_status was stored in the central + * repository, therefore the properties file only had three values. * * @return A set of tag name definition objects. */ @@ -253,19 +253,19 @@ final class TagNameDefinition implements Comparable { // Get the known status from the Central Repository String crTagKnownProp = ModuleSettings.getConfigSetting("CentralRepository", "db.badTags"); // NON-NLS List knownTagNameList = new ArrayList<>(); - if(crTagKnownProp != null && !crTagKnownProp.isEmpty()) { + if (crTagKnownProp != null && !crTagKnownProp.isEmpty()) { knownTagNameList.addAll(Arrays.asList(crTagKnownProp.split(","))); } - + tagDefinitions = buildTagNameDefinitions(customTagDefinitions, knownTagNameList); } else if (numberOfAttributes == 4) { tagDefinitions = buildTagNameDefinitions(customTagDefinitions); } - + // Remove the standard and project vic tags. List standardTagNames = getStandardTagNames(); - for(TagNameDefinition def: tagDefinitions) { - if(!standardTagNames.contains(def.getDisplayName())) { + for (TagNameDefinition def : tagDefinitions) { + if (!standardTagNames.contains(def.getDisplayName())) { tagNames.add(def); } } @@ -274,32 +274,32 @@ final class TagNameDefinition implements Comparable { } /** - * Returns a list of TagNameDefinitons created by merging the tag data - * from the properties file and the known status information from the central + * Returns a list of TagNameDefinitons created by merging the tag data from + * the properties file and the known status information from the central * repository. - * - * @param tagProperties List of description strings. - * @param centralRepoNotableTags List of known tag names. - * + * + * @param tagProperties List of description strings. + * @param centralRepoNotableTags List of known tag names. + * * @return A list of TagNameDefinitions. */ private static List buildTagNameDefinitions(List tagProperties, List centralRepoNotableTags) { List tagNameDefinitions = new ArrayList<>(); - + for (String propertyString : tagProperties) { // Split the property into attributes String[] attributes = propertyString.split(","); //get the attributes String tagName = attributes[0]; TskData.FileKnown knownStatus = TskData.FileKnown.UNKNOWN; - - if(centralRepoNotableTags.contains(tagName)) { + + if (centralRepoNotableTags.contains(tagName)) { knownStatus = TskData.FileKnown.BAD; } - + tagNameDefinitions.add(new TagNameDefinition(tagName, attributes[1], - TagName.HTML_COLOR.valueOf(attributes[2]), knownStatus)); + TagName.HTML_COLOR.valueOf(attributes[2]), knownStatus)); } - + return tagNameDefinitions; } @@ -308,14 +308,14 @@ final class TagNameDefinition implements Comparable { * preserved across cases. * * @param tagProperties List of description strings. - * + * * @param standardTagsToBeCreated the list of standard tags which have yet * to be created * * @return tagNames a list of TagNameDefinitions */ private static List buildTagNameDefinitions(List tagProperties) { - List tagNameDefinitions = new ArrayList<>(); + List tagNameDefinitions = new ArrayList<>(); for (String tagNameTuple : tagProperties) { String[] tagNameAttributes = tagNameTuple.split(","); //get the attributes tagNameDefinitions.add(new TagNameDefinition(tagNameAttributes[0], tagNameAttributes[1],