1
0
mirror of https://github.com/elisspace/autopsy.git synced 2026-09-06 02:24:30 +00:00

Restored new versions of GroupManager.java and SummaryTablePane.java

This commit is contained in:
APriestman
2015-03-12 13:27:51 -04:00
parent 87473709c1
commit bf8955ee7f
2 changed files with 12 additions and 6 deletions

View File

@@ -503,8 +503,6 @@ public class GroupManager implements FileUpdateEvent.FileUpdateListener {
}
}
//System.out.println("countAllFiles: " + db.countAllFiles());
//System.out.println("countFiles: " + db.countFiles());
return db.findAllFileIdsWhere("obj_id NOT IN (" + StringUtils.join(files, ',') + ")");
} else {
@@ -515,7 +513,6 @@ public class GroupManager implements FileUpdateEvent.FileUpdateListener {
files.add(ct.getContent().getId());
}
}
//System.out.println(" Found " + files.size() + " files in category " + category.getDisplayName());
return files;
}
@@ -525,11 +522,21 @@ public class GroupManager implements FileUpdateEvent.FileUpdateListener {
}
}
/**
* Count the number of files with the given category.
* This is faster than getFileIDsWithCategory and should be used if only the
* counts are needed and not the file IDs.
* @param category Category to match against
* @return Number of files with the given category
* @throws TskCoreException
*/
public int countFilesWithCategory(Category category) throws TskCoreException {
try {
if (category == Category.ZERO) {
//List<Long> files = new ArrayList<>();
// It is unlikely that Category Zero (Uncategorized) files will be tagged as such -
// this is really just the default setting. So we count the number of files
// tagged with the other categories and subtract from the total.
int allOtherCatCount = 0;
TagName[] tns = {Category.FOUR.getTagName(), Category.THREE.getTagName(), Category.TWO.getTagName(), Category.ONE.getTagName(), Category.FIVE.getTagName()};
for (TagName tn : tns) {

View File

@@ -105,8 +105,7 @@ public class SummaryTablePane extends AnchorPane implements Category.CategoryLis
for (Category cat : Category.values()) {
try {
//data.add(new Pair<>(cat, ImageAnalyzerController.getDefault().getGroupManager().getFileIDsWithCategory(cat).size()));
data.add(new Pair<>(cat, ImageAnalyzerController.getDefault().getGroupManager().countFilesWithCategory(cat)));
data.add(new Pair<>(cat, ImageAnalyzerController.getDefault().getGroupManager().countFilesWithCategory(cat)));
} catch (TskCoreException ex) {
Exceptions.printStackTrace(ex);
}