19 package org.sleuthkit.autopsy.casemodule.services;
21 import java.io.Closeable;
22 import java.io.IOException;
23 import java.util.Arrays;
24 import java.util.HashMap;
25 import java.util.List;
26 import java.util.logging.Level;
29 import org.openide.util.NbBundle;
77 if (!tagNamesInitialized) {
92 if (!tagNamesInitialized) {
106 if (!tagNamesInitialized) {
110 return uniqueTagNames.containsKey(tagDisplayName);
144 if (!tagNamesInitialized) {
148 if (uniqueTagNames.containsKey(displayName)) {
149 throw new TagNameAlreadyExistsException();
197 if (!tagNamesInitialized) {
201 if (beginByteOffset >= 0 && endByteOffset >= 1) {
202 if (beginByteOffset > content.getSize() - 1) {
203 throw new IllegalArgumentException(NbBundle.getMessage(
this.getClass(),
204 "TagsManager.addContentTag.exception.beginByteOffsetOOR.msg",
205 beginByteOffset, content.getSize() - 1));
208 if (endByteOffset > content.getSize() - 1) {
209 throw new IllegalArgumentException(
210 NbBundle.getMessage(
this.getClass(),
"TagsManager.addContentTag.exception.endByteOffsetOOR.msg",
211 endByteOffset, content.getSize() - 1));
214 if (endByteOffset < beginByteOffset) {
215 throw new IllegalArgumentException(
216 NbBundle.getMessage(
this.getClass(),
"TagsManager.addContentTag.exception.endLTbegin.msg"));
220 return tskCase.
addContentTag(content, tagName, comment, beginByteOffset, endByteOffset);
230 if (!tagNamesInitialized) {
244 if (!tagNamesInitialized) {
259 if (!tagNamesInitialized) {
274 if (!tagNamesInitialized) {
289 if (!tagNamesInitialized) {
317 if (!tagNamesInitialized) {
331 if (!tagNamesInitialized) {
345 if (!tagNamesInitialized) {
360 if (!tagNamesInitialized) {
375 if (!tagNamesInitialized) {
390 if (!tagNamesInitialized) {
398 public void close() throws IOException {
407 tagNamesInitialized =
true;
413 for (
TagName tagName : currentTagNames) {
414 uniqueTagNames.put(tagName.getDisplayName(), tagName);
424 if (null != setting && !setting.isEmpty()) {
426 List<String> tagNameTuples = Arrays.asList(setting.split(
";"));
430 for (String tagNameTuple : tagNameTuples) {
431 String[] tagNameAttributes = tagNameTuple.split(
",");
432 if (!uniqueTagNames.containsKey(tagNameAttributes[0])) {
446 if (!uniqueTagNames.containsKey(NbBundle.getMessage(
this.getClass(),
"TagsManager.predefTagNames.bookmark.text"))) {
449 NbBundle.getMessage(
this.getClass(),
"TagsManager.predefTagNames.bookmark.text"),
"",
TagName.
HTML_COLOR.
NONE);
459 if (!uniqueTagNames.isEmpty()) {
460 StringBuilder setting =
new StringBuilder();
461 for (
TagName tagName : uniqueTagNames.values()) {
462 if (setting.length() != 0) {
465 setting.append(tagName.getDisplayName()).append(
",");
466 setting.append(tagName.getDescription()).append(
",");
467 setting.append(tagName.getColor().name());
long getBlackboardArtifactTagsCountByTagName(TagName tagName)
List< BlackboardArtifactTag > getBlackboardArtifactTagsByArtifact(BlackboardArtifact artifact)
List< TagName > getTagNamesInUse()
List< ContentTag > getAllContentTags()
BlackboardArtifactTag addBlackboardArtifactTag(BlackboardArtifact artifact, TagName tagName, String comment)
void deleteBlackboardArtifactTag(BlackboardArtifactTag tag)
List< ContentTag > getContentTagsByTagName(TagName tagName)
static synchronized void setConfigSetting(String moduleName, String settingName, String settingVal)
List< TagName > getAllTagNames()
static HTML_COLOR getColorByName(String colorName)
List< BlackboardArtifactTag > getBlackboardArtifactTagsByTagName(TagName tagName)
List< BlackboardArtifactTag > getAllBlackboardArtifactTags()
static String getConfigSetting(String moduleName, String settingName)
void deleteContentTag(ContentTag tag)
long getContentTagsCountByTagName(TagName tagName)
List< ContentTag > getContentTagsByContent(Content content)
TagName addTagName(String displayName, String description, TagName.HTML_COLOR color)
ContentTag addContentTag(Content content, TagName tagName, String comment, long beginByteOffset, long endByteOffset)
static Logger getLogger(String name)