mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-14 17:06:16 +00:00
Fixed getNotableTagDisplayName
This commit is contained in:
parent
885c91c2d5
commit
5251ea50ae
@ -146,6 +146,12 @@ public class TagsManager implements Closeable {
|
|||||||
return tagDisplayNames;
|
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() {
|
public static List<String> getNotableTagDisplayNames() {
|
||||||
List<String> tagDisplayNames = new ArrayList<>();
|
List<String> tagDisplayNames = new ArrayList<>();
|
||||||
for (TagNameDefinition tagDef : TagNameDefinition.getTagNameDefinitions()) {
|
for (TagNameDefinition tagDef : TagNameDefinition.getTagNameDefinitions()) {
|
||||||
@ -153,6 +159,22 @@ public class TagsManager implements Closeable {
|
|||||||
tagDisplayNames.add(tagDef.getDisplayName());
|
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, "Faile to get list of TagNams from tagsManager.");
|
||||||
|
}
|
||||||
return tagDisplayNames;
|
return tagDisplayNames;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user