Return directly when file is to be ignored.

This commit is contained in:
U-BASIS\dgrove 2018-06-11 12:09:03 -04:00
parent 50546c77de
commit c97b22e7fb

View File

@ -138,23 +138,21 @@ final class EncryptionDetectionFileIngestModule extends FileIngestModuleAdapter
/*
* Has the file been deleted?
*/
if (!file.isMetaFlagSet(TskData.TSK_FS_META_FLAG_ENUM.UNALLOC)
&& !file.isDirNameFlagSet(TskData.TSK_FS_NAME_FLAG_ENUM.UNALLOC)) {
if (!file.isMetaFlagSet(TskData.TSK_FS_META_FLAG_ENUM.UNALLOC)) {
/*
* Is the file in FILE_IGNORE_LIST?
*/
boolean ignoreFile = false;
String filePath = file.getParentPath();
if (filePath.equals("/")) {
String fileName = file.getName();
for (String listEntry : FILE_IGNORE_LIST) {
if (fileName.equalsIgnoreCase(listEntry)) {
ignoreFile = true;
break;
// Skip this file.
return IngestModule.ProcessResult.OK;
}
}
}
if (!ignoreFile) {
/*
* Qualify the MIME type.
*/
@ -172,7 +170,6 @@ final class EncryptionDetectionFileIngestModule extends FileIngestModuleAdapter
}
}
}
}
} catch (ReadContentInputStreamException | SAXException | TikaException | UnsupportedCodecException ex) {
logger.log(Level.WARNING, String.format("Unable to read file '%s'", file.getParentPath() + file.getName()), ex);
return IngestModule.ProcessResult.ERROR;