mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-06 21:00:22 +00:00
update to use identifier
This commit is contained in:
parent
4f97008eb5
commit
db192c53c5
@ -620,7 +620,7 @@ public class HashDbManager implements PropertyChangeListener {
|
|||||||
final String knownStatus = match.group(KNOWN_STATUS_PARAM);
|
final String knownStatus = match.group(KNOWN_STATUS_PARAM);
|
||||||
|
|
||||||
KnownFilesType knownFilesType = Stream.of(HashDb.KnownFilesType.values())
|
KnownFilesType knownFilesType = Stream.of(HashDb.KnownFilesType.values())
|
||||||
.filter(k -> k.name().toUpperCase().equals(knownStatus.toUpperCase()))
|
.filter(k -> k.getIdentifier().toUpperCase().equals(knownStatus.toUpperCase()))
|
||||||
.findFirst()
|
.findFirst()
|
||||||
.orElseThrow(() -> new HashDbManagerException(String.format("No KnownFilesType matches %s for file: %s", knownStatus, filename)));
|
.orElseThrow(() -> new HashDbManagerException(String.format("No KnownFilesType matches %s for file: %s", knownStatus, filename)));
|
||||||
|
|
||||||
@ -804,17 +804,21 @@ public class HashDbManager implements PropertyChangeListener {
|
|||||||
})
|
})
|
||||||
public enum KnownFilesType {
|
public enum KnownFilesType {
|
||||||
|
|
||||||
KNOWN(Bundle.HashDbManager_known_text(), TskData.FileKnown.KNOWN, false, false),
|
KNOWN(Bundle.HashDbManager_known_text(), "Known", TskData.FileKnown.KNOWN, false, false),
|
||||||
KNOWN_BAD(Bundle.HashDbManager_knownBad_text(), TskData.FileKnown.BAD, true, true),
|
KNOWN_BAD(Bundle.HashDbManager_knownBad_text(), "Notable", TskData.FileKnown.BAD, true, true),
|
||||||
NO_CHANGE(Bundle.HashDbManager_noChange_text(), TskData.FileKnown.UNKNOWN, true, false);
|
NO_CHANGE(Bundle.HashDbManager_noChange_text(), "NoChange", TskData.FileKnown.UNKNOWN, true, false);
|
||||||
|
|
||||||
private final String displayName;
|
private final String displayName;
|
||||||
|
private final String identifier;
|
||||||
private final TskData.FileKnown fileKnown;
|
private final TskData.FileKnown fileKnown;
|
||||||
private final boolean allowSendInboxMessages;
|
private final boolean allowSendInboxMessages;
|
||||||
private final boolean defaultSendInboxMessages;
|
private final boolean defaultSendInboxMessages;
|
||||||
|
|
||||||
KnownFilesType(String displayName, TskData.FileKnown fileKnown, boolean allowSendInboxMessages, boolean defaultSendInboxMessages) {
|
KnownFilesType(String displayName, String identifier, TskData.FileKnown fileKnown,
|
||||||
|
boolean allowSendInboxMessages, boolean defaultSendInboxMessages) {
|
||||||
|
|
||||||
this.displayName = displayName;
|
this.displayName = displayName;
|
||||||
|
this.identifier = identifier;
|
||||||
this.fileKnown = fileKnown;
|
this.fileKnown = fileKnown;
|
||||||
this.allowSendInboxMessages = allowSendInboxMessages;
|
this.allowSendInboxMessages = allowSendInboxMessages;
|
||||||
this.defaultSendInboxMessages = defaultSendInboxMessages;
|
this.defaultSendInboxMessages = defaultSendInboxMessages;
|
||||||
@ -842,6 +846,16 @@ public class HashDbManager implements PropertyChangeListener {
|
|||||||
return defaultSendInboxMessages;
|
return defaultSendInboxMessages;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the identifier for this KnownFilesType. This is used for
|
||||||
|
* Official Hash Sets in their naming convention.
|
||||||
|
*
|
||||||
|
* @return The identifier for this type.
|
||||||
|
*/
|
||||||
|
String getIdentifier() {
|
||||||
|
return identifier;
|
||||||
|
}
|
||||||
|
|
||||||
public String getDisplayName() {
|
public String getDisplayName() {
|
||||||
return this.displayName;
|
return this.displayName;
|
||||||
}
|
}
|
||||||
|
2
thirdparty/OfficialHashSets/README.txt
vendored
2
thirdparty/OfficialHashSets/README.txt
vendored
@ -1 +1 @@
|
|||||||
.kdb files can be placed in this directory and they will be treated as Official Hash Sets within autopsy. Official Hash Sets will be readonly within the application. Official Hash Sets should have the following naming convention: '<dbName>.<knownStatus>.kdb' where '<dbName>' is the name of the Official Hash Set and '<knownStatus>' is the known status of the hash set. The known status is one of the variable names represented in the enum: HashDbManager.HashDb.KnownFilesType. As an example, a possible value could be: 'Foo.KNOWN.kdb' where the name of the Official Hash Set is 'Foo' and the known status is 'KNOWN.'
|
.kdb files can be placed in this directory and they will be treated as Official Hash Sets within autopsy. Official Hash Sets will be readonly within the application. Official Hash Sets should have the following naming convention: '<dbName>.<knownStatus>.kdb' where '<dbName>' is the name of the Official Hash Set and '<knownStatus>' is the known status of the hash set. The known status is the identifier for one of the variable names represented in the enum: HashDbManager.HashDb.KnownFilesType. As an example, a possible value could be: 'Foo.Notable.kdb' where the name of the Official Hash Set is 'Foo' and the known status is 'Notable' which is the identifier for KnownFilesType.KNOWN_BAD.
|
Loading…
x
Reference in New Issue
Block a user