mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-13 08:26:15 +00:00
Updated serialization protocol
This commit is contained in:
parent
4e37548993
commit
22165dc663
@ -151,12 +151,15 @@ final class InterestingItemDefsManager extends Observable {
|
|||||||
// multiple intersting files set definition files, e.g., one for
|
// multiple intersting files set definition files, e.g., one for
|
||||||
// definitions that ship with Autopsy and one for user definitions.
|
// definitions that ship with Autopsy and one for user definitions.
|
||||||
static Map<String, FilesSet> readDefinitionsFile(String filePath) throws InterestingItemDefsManagerException {
|
static Map<String, FilesSet> readDefinitionsFile(String filePath) throws InterestingItemDefsManagerException {
|
||||||
Map<String, FilesSet> filesSets = new HashMap<>();
|
Map<String, FilesSet> filesSets = readSerializedDefinitions();
|
||||||
|
|
||||||
|
if (!filesSets.isEmpty()) {
|
||||||
|
return filesSets;
|
||||||
|
}
|
||||||
// Check if the legacy xml file exists.
|
// Check if the legacy xml file exists.
|
||||||
File defsFile = new File(filePath);
|
File defsFile = new File(filePath);
|
||||||
if (!defsFile.exists()) {
|
if (!defsFile.exists()) {
|
||||||
return readSerializedDefinitions();
|
return filesSets;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if the file can be read.
|
// Check if the file can be read.
|
||||||
@ -510,10 +513,6 @@ final class InterestingItemDefsManager extends Observable {
|
|||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
throw new InterestingItemDefsManagerException(String.format("Failed to write settings to %s", filePath), ex);
|
throw new InterestingItemDefsManagerException(String.format("Failed to write settings to %s", filePath), ex);
|
||||||
}
|
}
|
||||||
File xmlFile = new File(LEGACY_FILE_SET_DEFS_PATH);
|
|
||||||
if (xmlFile.exists()) {
|
|
||||||
xmlFile.delete();
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user