Refactor test

This commit is contained in:
Ann Priestman 2017-09-26 14:38:13 -04:00
parent f813f6036c
commit ae4e0052f1

View File

@ -266,12 +266,30 @@ public class EamArtifactUtil {
* @return true if the file should be added to the central repo, false otherwise * @return true if the file should be added to the central repo, false otherwise
*/ */
public static boolean isValidCentralRepoFile(AbstractFile af){ public static boolean isValidCentralRepoFile(AbstractFile af){
if(af == null) return false; if(af == null){
return (false == ((af.getType() == TskData.TSK_DB_FILES_TYPE_ENUM.UNALLOC_BLOCKS) return false;
|| (af.getType() == TskData.TSK_DB_FILES_TYPE_ENUM.UNUSED_BLOCKS) }
|| (af.getType() == TskData.TSK_DB_FILES_TYPE_ENUM.SLACK)
|| (af.getKnown() == TskData.FileKnown.KNOWN) if(af.getKnown() == TskData.FileKnown.KNOWN){
|| (af.isDir() == true) return false;
|| ((af.getType() != TskData.TSK_DB_FILES_TYPE_ENUM.CARVED) && !af.isMetaFlagSet(TskData.TSK_FS_META_FLAG_ENUM.ALLOC)))); }
switch (af.getType()){
case UNALLOC_BLOCKS:
case UNUSED_BLOCKS:
case SLACK:
case VIRTUAL_DIR:
case LOCAL_DIR:
return false;
case CARVED:
case DERIVED:
case LOCAL:
return true;
case FS:
return af.isMetaFlagSet(TskData.TSK_FS_META_FLAG_ENUM.ALLOC);
default:
LOGGER.log(Level.WARNING, "Unexpected file type {0}", af.getType().getName());
return false;
}
} }
} }