mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-17 18:17:43 +00:00
Merge pull request #1286 from sidheshenator/file_type_identification
non-files, 0-sized, unalloc, unused blocks marked as octet stream
This commit is contained in:
commit
cf115e2aa6
@ -101,7 +101,7 @@ public class FileTypeDetector {
|
||||
* detection succeeds.
|
||||
*
|
||||
* @param file The file to test.
|
||||
* @return The MIME type name id detection was successful, null otherwise.
|
||||
* @return The MIME type name if detection was successful, null otherwise.
|
||||
* @throws TskCoreException
|
||||
*/
|
||||
public String getFileType(AbstractFile file) throws TskCoreException {
|
||||
@ -152,11 +152,11 @@ public class FileTypeDetector {
|
||||
* @throws TskCoreException
|
||||
*/
|
||||
public String detect(AbstractFile file) throws TskCoreException {
|
||||
if (!file.isFile() || file.getSize() <= 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if ((file.getType() == TskData.TSK_DB_FILES_TYPE_ENUM.UNALLOC_BLOCKS)
|
||||
// consistently mark non-regular files (refer TskData.TSK_FS_META_TYPE_ENUM),
|
||||
// 0 sized files, unallocated, and unused blocks (refer TskData.TSK_DB_FILES_TYPE_ENUM)
|
||||
// as octet-stream.
|
||||
if (!file.isFile() || file.getSize() <= 0
|
||||
|| (file.getType() == TskData.TSK_DB_FILES_TYPE_ENUM.UNALLOC_BLOCKS)
|
||||
|| (file.getType() == TskData.TSK_DB_FILES_TYPE_ENUM.UNUSED_BLOCKS)) {
|
||||
return MimeTypes.OCTET_STREAM;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user