mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-17 02:07:42 +00:00
3198 comment getTagNameDefinitions
This commit is contained in:
parent
e1770f5fdf
commit
c2d0bbb932
@ -85,13 +85,14 @@ final class TagNameDefiniton implements Comparable<TagNameDefiniton> {
|
|||||||
TagName.HTML_COLOR getColor() {
|
TagName.HTML_COLOR getColor() {
|
||||||
return color;
|
return color;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
boolean isNotable(){
|
boolean isNotable() {
|
||||||
return knownStatusDenoted == TskData.FileKnown.BAD;
|
return knownStatusDenoted == TskData.FileKnown.BAD;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compares this tag name definition with the specified tag name definition
|
* Compares this tag name definition with the specified tag name definition
|
||||||
* for order.
|
* for order.
|
||||||
@ -164,28 +165,28 @@ final class TagNameDefiniton implements Comparable<TagNameDefiniton> {
|
|||||||
Set<TagNameDefiniton> tagNames = new HashSet<>();
|
Set<TagNameDefiniton> tagNames = new HashSet<>();
|
||||||
String setting = ModuleSettings.getConfigSetting(TAGS_SETTINGS_NAME, TAG_NAMES_SETTING_KEY);
|
String setting = ModuleSettings.getConfigSetting(TAGS_SETTINGS_NAME, TAG_NAMES_SETTING_KEY);
|
||||||
if (null != setting && !setting.isEmpty()) {
|
if (null != setting && !setting.isEmpty()) {
|
||||||
List<String> badTags = null;
|
List<String> notableTags = null;
|
||||||
List<String> tagNameTuples = Arrays.asList(setting.split(";"));
|
List<String> tagNameTuples = Arrays.asList(setting.split(";"));
|
||||||
for (String tagNameTuple : tagNameTuples) {
|
for (String tagNameTuple : tagNameTuples) {
|
||||||
String[] tagNameAttributes = tagNameTuple.split(",");
|
String[] tagNameAttributes = tagNameTuple.split(",");
|
||||||
if (tagNameAttributes.length == 3) {
|
if (tagNameAttributes.length == 3) { //Upgrade case Tags.properties does not contain any tag definitions with knownStatus
|
||||||
if (badTags == null) {
|
if (notableTags == null) {
|
||||||
String badTagsStr = ModuleSettings.getConfigSetting("CentralRepository", "db.badTags"); // NON-NLS
|
String badTagsStr = ModuleSettings.getConfigSetting("CentralRepository", "db.badTags"); // NON-NLS
|
||||||
if (badTagsStr == null) {
|
if (badTagsStr == null) { //if a badtags list could not be read from a central repository properties file use the defualt bad tags
|
||||||
badTagsStr = STANDARD_NOTABLE_TAG_DISPLAY_NAMES;
|
badTagsStr = STANDARD_NOTABLE_TAG_DISPLAY_NAMES;
|
||||||
}
|
}
|
||||||
if (badTagsStr.isEmpty()) {
|
if (badTagsStr.isEmpty()) { //if a badtags list is empty the user has saved all tags as non-notable so we will have all tags non-notable
|
||||||
badTags = new ArrayList<>();
|
notableTags = new ArrayList<>();
|
||||||
} else {
|
} else {
|
||||||
badTags = new ArrayList<>(Arrays.asList(badTagsStr.split(",")));
|
notableTags = new ArrayList<>(Arrays.asList(badTagsStr.split(","))); //if the badtags list was present and had contents use the contents as the current notable tags list
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (badTags.contains(tagNameAttributes[0])) {
|
if (notableTags.contains(tagNameAttributes[0])) { //if the name attribute is in the notable tags list add the tag as a notable tag
|
||||||
tagNames.add(new TagNameDefiniton(tagNameAttributes[0], tagNameAttributes[1], TagName.HTML_COLOR.valueOf(tagNameAttributes[2]), TskData.FileKnown.BAD));
|
tagNames.add(new TagNameDefiniton(tagNameAttributes[0], tagNameAttributes[1], TagName.HTML_COLOR.valueOf(tagNameAttributes[2]), TskData.FileKnown.BAD));
|
||||||
} else {
|
} else { //otherwise add the tag as a default knownStatus tag
|
||||||
tagNames.add(new TagNameDefiniton(tagNameAttributes[0], tagNameAttributes[1], TagName.HTML_COLOR.valueOf(tagNameAttributes[2]), TskData.FileKnown.UNKNOWN)); //add the default value for that tag
|
tagNames.add(new TagNameDefiniton(tagNameAttributes[0], tagNameAttributes[1], TagName.HTML_COLOR.valueOf(tagNameAttributes[2]), TskData.FileKnown.UNKNOWN)); //add the default value for that tag
|
||||||
}
|
}
|
||||||
} else if (tagNameAttributes.length == 4) {
|
} else if (tagNameAttributes.length == 4) { //if there are 4 attributes its a current list we can use the values present
|
||||||
tagNames.add(new TagNameDefiniton(tagNameAttributes[0], tagNameAttributes[1], TagName.HTML_COLOR.valueOf(tagNameAttributes[2]), TskData.FileKnown.valueOf(tagNameAttributes[3])));
|
tagNames.add(new TagNameDefiniton(tagNameAttributes[0], tagNameAttributes[1], TagName.HTML_COLOR.valueOf(tagNameAttributes[2]), TskData.FileKnown.valueOf(tagNameAttributes[3])));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -194,7 +195,6 @@ final class TagNameDefiniton implements Comparable<TagNameDefiniton> {
|
|||||||
return tagNames;
|
return tagNames;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the tag name definitions in the tag settings file.
|
* Sets the tag name definitions in the tag settings file.
|
||||||
*
|
*
|
||||||
|
@ -119,8 +119,7 @@ public class TagsManager implements Closeable {
|
|||||||
*
|
*
|
||||||
* @param caseDb The case database.
|
* @param caseDb The case database.
|
||||||
*/
|
*/
|
||||||
TagsManager(SleuthkitCase caseDb
|
TagsManager(SleuthkitCase caseDb) {
|
||||||
) {
|
|
||||||
this.caseDb = caseDb;
|
this.caseDb = caseDb;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -237,11 +236,7 @@ public class TagsManager implements Closeable {
|
|||||||
* name to the case database.
|
* name to the case database.
|
||||||
*/
|
*/
|
||||||
public synchronized TagName addTagName(String displayName, String description, TagName.HTML_COLOR color) throws TagNameAlreadyExistsException, TskCoreException {
|
public synchronized TagName addTagName(String displayName, String description, TagName.HTML_COLOR color) throws TagNameAlreadyExistsException, TskCoreException {
|
||||||
TskData.FileKnown knownStatus = TskData.FileKnown.UNKNOWN;
|
return addTagName(displayName, description, color, knownStatus,TskData.FileKnown.UNKNOWN);
|
||||||
if (getNotableTagDisplayNames().contains(displayName)) {
|
|
||||||
knownStatus = TskData.FileKnown.BAD;
|
|
||||||
}
|
|
||||||
return addTagName(displayName, description, color, knownStatus);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user