mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-15 09:17:42 +00:00
Merge pull request #5883 from kellykelly3/1452-fix-TagsManager-getNotableTagDisplay
1452 - Fixed getNotableTagDisplayName
This commit is contained in:
commit
9dde738f12
@ -146,6 +146,12 @@ public class TagsManager implements Closeable {
|
||||
return tagDisplayNames;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the set of display names of notable (TskData.FileKnown.BAD) tag types.
|
||||
* If a case is not open the list will only include only the user defined
|
||||
* custom tags. Otherwise the list will include all notable tags.
|
||||
* @return
|
||||
*/
|
||||
public static List<String> getNotableTagDisplayNames() {
|
||||
List<String> tagDisplayNames = new ArrayList<>();
|
||||
for (TagNameDefinition tagDef : TagNameDefinition.getTagNameDefinitions()) {
|
||||
@ -153,6 +159,22 @@ public class TagsManager implements Closeable {
|
||||
tagDisplayNames.add(tagDef.getDisplayName());
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
TagsManager tagsManager = Case.getCurrentCaseThrows().getServices().getTagsManager();
|
||||
for (TagName tagName : tagsManager.getAllTagNames()) {
|
||||
if(tagName.getKnownStatus() == TskData.FileKnown.BAD &&
|
||||
!tagDisplayNames.contains(tagName.getDisplayName())) {
|
||||
tagDisplayNames.add(tagName.getDisplayName());
|
||||
}
|
||||
}
|
||||
} catch (NoCurrentCaseException ignored) {
|
||||
/*
|
||||
* No current case, nothing more to add to the set.
|
||||
*/
|
||||
} catch(TskCoreException ex) {
|
||||
LOGGER.log(Level.SEVERE, "Failed to get list of TagNames from TagsManager.", ex);
|
||||
}
|
||||
return tagDisplayNames;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user