45 @NbBundle.Messages({
"FilesSetsManager.allFilesAndDirectories=All Files and Directories (Not Unallocated Space)",
46 "FilesSetsManager.allFilesDirectoriesAndUnallocated=All Files, Directories, and Unallocated Space"})
47 private static final List<String>
ILLEGAL_FILE_NAME_CHARS = Collections.unmodifiableList(
new ArrayList<>(Arrays.asList(
"\\",
"/",
":",
"*",
"?",
"\"",
"<",
">")));
48 private static final List<String>
ILLEGAL_FILE_PATH_CHARS = Collections.unmodifiableList(
new ArrayList<>(Arrays.asList(
"\\",
":",
"*",
"?",
"\"",
"<",
">")));
60 Bundle.FilesSetsManager_allFilesAndDirectories(), Bundle.FilesSetsManager_allFilesAndDirectories(),
false,
true,
new HashMap<String, Rule>() {
62 put(Bundle.FilesSetsManager_allFilesAndDirectories(),
63 new Rule(Bundle.FilesSetsManager_allFilesAndDirectories(), null,
64 new MetaTypeCondition(MetaTypeCondition.Type.ALL), null, null, null, null, null));
68 Bundle.FilesSetsManager_allFilesDirectoriesAndUnallocated(), Bundle.FilesSetsManager_allFilesDirectoriesAndUnallocated(),
69 false,
false,
new HashMap<String, Rule>() {
71 put(Bundle.FilesSetsManager_allFilesDirectoriesAndUnallocated(),
72 new Rule(Bundle.FilesSetsManager_allFilesDirectoriesAndUnallocated(), null,
73 new MetaTypeCondition(MetaTypeCondition.Type.ALL), null, null, null, null, null));
91 static String getFileFilterPath() {
92 return FILE_FILTER_PATH;
98 static String getInterestingItemPath() {
99 return INTERESTING_ITEM_PATH;
107 static List<String> getIllegalFileNameChars() {
108 return FilesSetsManager.ILLEGAL_FILE_NAME_CHARS;
117 static List<String> getIllegalFilePathChars() {
118 return FilesSetsManager.ILLEGAL_FILE_PATH_CHARS;
162 synchronized (FILE_INGEST_FILTER_LOCK) {
187 synchronized (INTERESTING_FILES_SET_LOCK) {
190 this.notifyObservers();
197 void upgradeConfig() throws IOException {
198 for (String fileName :
new String[]{LEGACY_FILES_SET_DEFS_FILE_NAME, FILE_INGEST_FILTER_DEFS_NAME, INTERESTING_FILES_SET_DEFS_NAME }) {
199 File oldPath = Paths.get(LEGACY_SETTINGS_PATH, fileName).toFile();
200 File newPath = Paths.get(SETTINGS_PATH, fileName).toFile();
202 if (oldPath.exists() && !newPath.exists()) {
203 newPath.getParentFile().mkdirs();
204 FileUtils.copyFile(oldPath, newPath);
209 public static class FilesSetsManagerException
extends Exception {
211 FilesSetsManagerException() {
215 FilesSetsManagerException(String message) {
219 FilesSetsManagerException(String message, Throwable cause) {
220 super(message, cause);
223 FilesSetsManagerException(Throwable cause) {