Autopsy 4.22.1
Graphical digital forensics platform for The Sleuth Kit and other tools.
KeywordListsManager.java
Go to the documentation of this file.
1/*
2 * Autopsy Forensic Browser
3 *
4 * Copyright 2014-2019 Basis Technology Corp.
5 * Contact: carrier <at> sleuthkit <dot> org
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 */
19package org.sleuthkit.autopsy.keywordsearch;
20
21import java.beans.PropertyChangeEvent;
22import java.beans.PropertyChangeListener;
23import java.util.ArrayList;
24import java.util.List;
25import java.util.Observable;
26
30// TODO (RC): This class is a first step towards a fully functional and public
31// keyword list manager, establishing the beginning of a public API. It is
32// motivated by a desire to not expose XmlKeywordSearchList to public clients.
33// It should be futher developed as time constraints and needs dictate.
34public class KeywordListsManager extends Observable {
35
37 private final PropertyChangeListener listsChangeListener;
38
43 this.listsChangeListener = new PropertyChangeListener() {
44 @Override
45 public void propertyChange(PropertyChangeEvent evt) {
46 KeywordListsManager.this.setChanged();
47 KeywordListsManager.this.notifyObservers();
48 }
49 };
50 XmlKeywordSearchList.getCurrent().addPropertyChangeListener(this.listsChangeListener);
51 }
52
58 public static synchronized KeywordListsManager getInstance() {
59 if (instance == null) {
61 }
62 return instance;
63 }
64
70 public List<String> getKeywordListNames() {
71 List<String> names = new ArrayList<>();
72 for (KeywordList list : XmlKeywordSearchList.getCurrent().getListsL()) {
73 names.add(list.getName());
74 }
75 return names;
76 }
77
85 public KeywordList getList(String name) {
86 return XmlKeywordSearchList.getCurrent().getList(name);
87 }
88
92 public static void reloadKeywordLists(){
93 XmlKeywordSearchList.getCurrent().reload();
94 }
95
96}
static synchronized KeywordListsManager getInstance()

Copyright © 2012-2024 Sleuth Kit Labs. Generated on:
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.