mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-19 19:14:55 +00:00
Cleanup
This commit is contained in:
parent
9cc777ecdd
commit
ac7f1ca387
@ -58,7 +58,6 @@ import org.sleuthkit.autopsy.coreutils.History;
|
|||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.imageanalyzer.datamodel.DrawableDB;
|
import org.sleuthkit.autopsy.imageanalyzer.datamodel.DrawableDB;
|
||||||
import org.sleuthkit.autopsy.imageanalyzer.datamodel.DrawableFile;
|
import org.sleuthkit.autopsy.imageanalyzer.datamodel.DrawableFile;
|
||||||
import org.sleuthkit.autopsy.imageanalyzer.datamodel.Category; // TEMP
|
|
||||||
import org.sleuthkit.autopsy.imageanalyzer.grouping.GroupManager;
|
import org.sleuthkit.autopsy.imageanalyzer.grouping.GroupManager;
|
||||||
import org.sleuthkit.autopsy.imageanalyzer.grouping.GroupViewState;
|
import org.sleuthkit.autopsy.imageanalyzer.grouping.GroupViewState;
|
||||||
import org.sleuthkit.autopsy.imageanalyzer.gui.NoGroupsDialog;
|
import org.sleuthkit.autopsy.imageanalyzer.gui.NoGroupsDialog;
|
||||||
@ -496,9 +495,11 @@ public final class ImageAnalyzerController {
|
|||||||
try {
|
try {
|
||||||
// @@@ Could probably do something more fancy here and check if we've been canceled every now and then
|
// @@@ Could probably do something more fancy here and check if we've been canceled every now and then
|
||||||
InnerTask it = workQueue.take();
|
InnerTask it = workQueue.take();
|
||||||
|
|
||||||
if (it.cancelled == false) {
|
if (it.cancelled == false) {
|
||||||
it.run();
|
it.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
Platform.runLater(() -> {
|
Platform.runLater(() -> {
|
||||||
queueSizeProperty.set(workQueue.size());
|
queueSizeProperty.set(workQueue.size());
|
||||||
});
|
});
|
||||||
@ -601,53 +602,6 @@ public final class ImageAnalyzerController {
|
|||||||
|
|
||||||
public UpdateFileTask(AbstractFile f) {
|
public UpdateFileTask(AbstractFile f) {
|
||||||
super(f);
|
super(f);
|
||||||
// TEMP TEMP TEMP
|
|
||||||
/*
|
|
||||||
if(f.getName().startsWith("a")){
|
|
||||||
try{
|
|
||||||
Case.getCurrentCase().getServices().getTagsManager().addContentTag(f, Category.ONE.getTagName(), "");
|
|
||||||
}
|
|
||||||
catch (TskCoreException ex){
|
|
||||||
System.out.println(" FAIL FAIL" + ex.getLocalizedMessage());
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(f.getName().startsWith("b")){
|
|
||||||
try{
|
|
||||||
Case.getCurrentCase().getServices().getTagsManager().addContentTag(f, Category.TWO.getTagName(), "");
|
|
||||||
}
|
|
||||||
catch (TskCoreException ex){
|
|
||||||
System.out.println(" FAIL FAIL" + ex.getLocalizedMessage());
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(f.getName().startsWith("c")){
|
|
||||||
try{
|
|
||||||
Case.getCurrentCase().getServices().getTagsManager().addContentTag(f, Category.THREE.getTagName(), "");
|
|
||||||
}
|
|
||||||
catch (TskCoreException ex){
|
|
||||||
System.out.println(" FAIL FAIL" + ex.getLocalizedMessage());
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(f.getName().startsWith("d")){
|
|
||||||
try{
|
|
||||||
Case.getCurrentCase().getServices().getTagsManager().addContentTag(f, Category.FOUR.getTagName(), "");
|
|
||||||
}
|
|
||||||
catch (TskCoreException ex){
|
|
||||||
System.out.println(" FAIL FAIL" + ex.getLocalizedMessage());
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(f.getName().startsWith("e")){
|
|
||||||
try{
|
|
||||||
Case.getCurrentCase().getServices().getTagsManager().addContentTag(f, Category.FIVE.getTagName(), "");
|
|
||||||
}
|
|
||||||
catch (TskCoreException ex){
|
|
||||||
System.out.println(" FAIL FAIL" + ex.getLocalizedMessage());
|
|
||||||
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -655,7 +609,6 @@ public final class ImageAnalyzerController {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
|
||||||
DrawableFile<?> drawableFile = DrawableFile.create(getFile(), true);
|
DrawableFile<?> drawableFile = DrawableFile.create(getFile(), true);
|
||||||
db.updateFile(drawableFile);
|
db.updateFile(drawableFile);
|
||||||
}
|
}
|
||||||
|
@ -691,8 +691,8 @@ public class DrawableDB {
|
|||||||
try {
|
try {
|
||||||
List<Long> fileIDsInGroup = getFileIDsInGroup(gk);
|
List<Long> fileIDsInGroup = getFileIDsInGroup(gk);
|
||||||
|
|
||||||
|
|
||||||
try{
|
try{
|
||||||
|
// In testing, this method appears to be a lot faster than doing one large select statement
|
||||||
for(Long fileID:fileIDsInGroup){
|
for(Long fileID:fileIDsInGroup){
|
||||||
Statement stmt = con.createStatement();
|
Statement stmt = con.createStatement();
|
||||||
ResultSet analyzedQuery = stmt.executeQuery("select analyzed from drawable_files where obj_id = " + fileID);
|
ResultSet analyzedQuery = stmt.executeQuery("select analyzed from drawable_files where obj_id = " + fileID);
|
||||||
@ -700,22 +700,19 @@ public class DrawableDB {
|
|||||||
if(analyzedQuery.getInt(ANALYZED) == 0){
|
if(analyzedQuery.getInt(ANALYZED) == 0){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
//System.out.println("fileID = " + fileID + ", analyzed = " + analyzedQuery.getInt(ANALYZED));
|
|
||||||
}
|
}
|
||||||
System.out.println("## Group is fully analyzed!!!");
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (SQLException ex) {
|
} catch (SQLException ex) {
|
||||||
LOGGER.log(Level.WARNING, "problem counting analyzed files: ", ex);
|
LOGGER.log(Level.WARNING, "problem counting analyzed files: ", ex);
|
||||||
System.out.println("Error: " + ex.getLocalizedMessage());
|
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
// Old method
|
||||||
try (Statement stmt = con.createStatement();
|
try (Statement stmt = con.createStatement();
|
||||||
//Can't make this a preprared statement because of the IN ( ... )
|
//Can't make this a preprared statement because of the IN ( ... )
|
||||||
ResultSet analyzedQuery = stmt.executeQuery("select count(analyzed) as analyzed from drawable_files where analyzed = 1 and obj_id in (" + StringUtils.join(fileIDsInGroup, ", ") + ")")) {
|
ResultSet analyzedQuery = stmt.executeQuery("select count(analyzed) as analyzed from drawable_files where analyzed = 1 and obj_id in (" + StringUtils.join(fileIDsInGroup, ", ") + ")")) {
|
||||||
while (analyzedQuery.next()) {
|
while (analyzedQuery.next()) {
|
||||||
//System.out.println("Full group result: " + analyzedQuery.getInt(ANALYZED) + "\n");
|
|
||||||
return analyzedQuery.getInt(ANALYZED) == fileIDsInGroup.size();
|
return analyzedQuery.getInt(ANALYZED) == fileIDsInGroup.size();
|
||||||
}
|
}
|
||||||
} catch (SQLException ex) {
|
} catch (SQLException ex) {
|
||||||
@ -771,7 +768,6 @@ public class DrawableDB {
|
|||||||
}
|
}
|
||||||
dbReadUnlock();
|
dbReadUnlock();
|
||||||
}
|
}
|
||||||
//System.out.println("Found " + ret.size() + " files matching " + sqlWhereClause);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user