19 package org.sleuthkit.autopsy.modules.interestingitems;
21 import java.util.ArrayList;
22 import java.util.Arrays;
23 import java.util.Collections;
24 import java.util.HashMap;
25 import java.util.List;
27 import java.util.Observable;
28 import org.openide.util.NbBundle;
40 @NbBundle.Messages({
"FilesSetsManager.allFilesAndDirectories=All Files and Directories (Not Unallocated Space)",
41 "FilesSetsManager.allFilesDirectoriesAndUnallocated=All Files, Directories, and Unallocated Space"})
42 private static final List<String>
ILLEGAL_FILE_NAME_CHARS = Collections.unmodifiableList(
new ArrayList<>(Arrays.asList(
"\\",
"/",
":",
"*",
"?",
"\"",
"<",
">")));
43 private static final List<String>
ILLEGAL_FILE_PATH_CHARS = Collections.unmodifiableList(
new ArrayList<>(Arrays.asList(
"\\",
":",
"*",
"?",
"\"",
"<",
">")));
51 Bundle.FilesSetsManager_allFilesAndDirectories(), Bundle.FilesSetsManager_allFilesAndDirectories(),
false,
true,
new HashMap<String, Rule>() {
53 put(Bundle.FilesSetsManager_allFilesAndDirectories(),
54 new Rule(Bundle.FilesSetsManager_allFilesAndDirectories(), null,
59 Bundle.FilesSetsManager_allFilesDirectoriesAndUnallocated(), Bundle.FilesSetsManager_allFilesDirectoriesAndUnallocated(),
60 false,
false,
new HashMap<String, Rule>() {
62 put(Bundle.FilesSetsManager_allFilesDirectoriesAndUnallocated(),
63 new Rule(Bundle.FilesSetsManager_allFilesDirectoriesAndUnallocated(), null,
72 if (instance == null) {
83 static List<String> getIllegalFileNameChars() {
93 static List<String> getIllegalFilePathChars() {
94 return FilesSetsManager.ILLEGAL_FILE_PATH_CHARS;
103 return Arrays.asList(FILES_DIRS_UNALLOC_INGEST_FILTER, FILES_DIRS_INGEST_FILTER);
116 return FileSetsDefinitions.readSerializedDefinitions(FILE_INGEST_FILTER_DEFS_NAME);
137 void setCustomFileIngestFilters(Map<String, FilesSet> filesSets)
throws FilesSetsManagerException {
139 FileSetsDefinitions.writeDefinitionsFile(FILE_INGEST_FILTER_DEFS_NAME, filesSets);
152 return InterestingItemsFilesSetSettings.readDefinitionsFile(INTERESTING_FILES_SET_DEFS_NAME, LEGACY_FILES_SET_DEFS_FILE_NAME);
164 void setInterestingFilesSets(Map<String, FilesSet> filesSets)
throws FilesSetsManagerException {
166 InterestingItemsFilesSetSettings.writeDefinitionsFile(INTERESTING_FILES_SET_DEFS_NAME, filesSets);
168 this.notifyObservers();
185 super(message, cause);
static final String INTERESTING_FILES_SET_DEFS_NAME
static List< FilesSet > getStandardFileIngestFilters()
static final FilesSet FILES_DIRS_INGEST_FILTER
Map< String, FilesSet > getInterestingFilesSets()
static final Object FILE_INGEST_FILTER_LOCK
static final List< String > ILLEGAL_FILE_PATH_CHARS
static synchronized FilesSetsManager getInstance()
static FilesSetsManager instance
Map< String, FilesSet > getCustomFileIngestFilters()
static final List< String > ILLEGAL_FILE_NAME_CHARS
static FilesSet getDefaultFilter()
static final String LEGACY_FILES_SET_DEFS_FILE_NAME
static final Object INTERESTING_FILES_SET_LOCK
static final String FILE_INGEST_FILTER_DEFS_NAME
static final FilesSet FILES_DIRS_UNALLOC_INGEST_FILTER