Skip to content

Commit

Permalink
Reduced RecentActivity API via making veriables private and reducing …
Browse files Browse the repository at this point in the history
…scope of classes. Also removed dead enums
  • Loading branch information
bcarrier committed Jan 16, 2014
1 parent 2fcce87 commit 4692715
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 147 deletions.
2 changes: 0 additions & 2 deletions API-CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,3 @@ Changes to make to API when we are ready to make backward incompatible changes:
- HTMLReport has special API for more context on columns and special handling in REportGenerator. Change all reports to the new API.
- Content.getUniquePath() should not thrown TskException. We should deal with it in the method.
- Make the list of events that Case fires off to be part of an enum to group them together (like IngestManager does).
- Sub-modules in RecentActivity have a bunch of public/protected variables that do not need to be. (i.e. ExtractRegistry.rrFullFound).
- Delete BrowserType enum and BrowserActivityType in RecentActivity.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
/**
* Chrome recent activity extraction
*/
public class Chrome extends Extract {
class Chrome extends Extract {

private static final String historyQuery = "SELECT urls.url, urls.title, urls.visit_count, urls.typed_count, "
+ "last_visit_time, urls.hidden, visits.visit_time, (SELECT urls.url FROM urls WHERE urls.id=visits.url) as from_visit, visits.transition FROM urls, visits WHERE urls.id = visits.url";
Expand All @@ -65,8 +65,8 @@ public class Chrome extends Extract {
private static final String downloadQueryVersion30 = "SELECT current_path as full_path, url, start_time, received_bytes FROM downloads, downloads_url_chains WHERE downloads.id=downloads_url_chains.id";
private static final String loginQuery = "select origin_url, username_value, signon_realm from logins";
private final Logger logger = Logger.getLogger(this.getClass().getName());
public int ChromeCount = 0;
final public static String MODULE_VERSION = "1.0";
private int ChromeCount = 0;
final private static String MODULE_VERSION = "1.0";
private IngestServices services;

//hide public constructor to prevent from instantiation by ingest module loader
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@
import org.sleuthkit.autopsy.report.SQLiteDBConnect;
import org.sleuthkit.datamodel.*;

abstract public class Extract extends IngestModuleDataSource{
abstract class Extract extends IngestModuleDataSource{

protected Case currentCase = Case.getCurrentCase(); // get the most updated case
protected SleuthkitCase tskCase = currentCase.getSleuthkitCase();
public final Logger logger = Logger.getLogger(this.getClass().getName());
protected final ArrayList<String> errorMessages = new ArrayList<>();
protected String moduleName = "";
protected boolean dataFound = false;
private final ArrayList<String> errorMessages = new ArrayList<>();
String moduleName = "";
boolean dataFound = false;

//hide public constructor to prevent from instantiation by ingest module loader
Extract() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
import org.sleuthkit.autopsy.ingest.IngestModuleInit;
import org.sleuthkit.datamodel.*;

public class ExtractIE extends Extract {
class ExtractIE extends Extract {
private static final Logger logger = Logger.getLogger(ExtractIE.class.getName());
private IngestServices services;

Expand All @@ -77,7 +77,7 @@ public class ExtractIE extends Extract {
private String PASCO_LIB_PATH;
private String JAVA_PATH;

final public static String MODULE_VERSION = "1.0";
final private static String MODULE_VERSION = "1.0";
private static final SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");

private ExecUtil execPasco;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@
* and the second is a set that were customized for Autopsy to produce a more structured
* output of XML so that we can parse and turn into blackboard artifacts.
*/
public class ExtractRegistry extends Extract {
class ExtractRegistry extends Extract {

public Logger logger = Logger.getLogger(this.getClass().getName());
private Logger logger = Logger.getLogger(this.getClass().getName());
private String RR_PATH;
private String RR_FULL_PATH;
boolean rrFound = false; // true if we found the Autopsy-specific version of regripper
boolean rrFullFound = false; // true if we found the full version of regripper
final public static String MODULE_VERSION = "1.0";
private boolean rrFound = false; // true if we found the Autopsy-specific version of regripper
private boolean rrFullFound = false; // true if we found the full version of regripper
final private static String MODULE_VERSION = "1.0";
private ExecUtil execRR;

//hide public constructor to prevent from instantiation by ingest module loader
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
* Loads a file that maps USB IDs to names of makes and models. Uses Linux USB info.
* This should be renamed because it isn't extracting. It's just mapping IDs to names.
*/
public class ExtractUSB {
class ExtractUSB {
private static final Logger logger = Logger.getLogger(ExtractUSB.class.getName());
private HashMap<String, USBInfo> devices;
private static final String DataFile = "USB_DATA.txt";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
/**
* Firefox recent activity extraction
*/
public class Firefox extends Extract {
class Firefox extends Extract {

private static final String historyQuery = "SELECT moz_historyvisits.id,url,title,visit_count,(visit_date/1000000) as visit_date,from_visit,(SELECT url FROM moz_places WHERE id=moz_historyvisits.from_visit) as ref FROM moz_places, moz_historyvisits WHERE moz_places.id = moz_historyvisits.place_id AND hidden = 0";
private static final String cookieQuery = "SELECT name,value,host,expiry,(lastAccessed/1000000) as lastAccessed,(creationTime/1000000) as creationTime FROM moz_cookies";
Expand All @@ -59,8 +59,7 @@ public class Firefox extends Extract {
private static final String downloadQuery = "SELECT target, source,(startTime/1000000) as startTime, maxBytes FROM moz_downloads";
private static final String downloadQueryVersion24 = "SELECT url, content as target, (lastModified/1000000) as lastModified FROM moz_places, moz_annos WHERE moz_places.id = moz_annos.place_id AND moz_annos.anno_attribute_id = 3";

public int FireFoxCount = 0;
final public static String MODULE_VERSION = "1.0";
final private static String MODULE_VERSION = "1.0";
private IngestServices services;

//hide public constructor to prevent from instantiation by ingest module loader
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public final class RAImageIngestModule extends IngestModuleDataSource {
private StringBuilder subCompleted = new StringBuilder();
private ArrayList<Extract> modules;
private List<Extract> browserModules;
final public static String MODULE_VERSION = Version.getVersion();
final private static String MODULE_VERSION = Version.getVersion();

//public constructor is required
//as multiple instances are created for processing multiple images simultenously
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@
* To add search engines, edit SearchEngines.xml under RecentActivity
*
*/
public class SearchEngineURLQueryAnalyzer extends Extract {
class SearchEngineURLQueryAnalyzer extends Extract {

private IngestServices services;

public static final String MODULE_NAME = "Search Engine URL Query Analyzer";
public final static String MODULE_VERSION = "1.0";
private static final String MODULE_NAME = "Search Engine URL Query Analyzer";
private final static String MODULE_VERSION = "1.0";

public static final String XMLFILE = "SEUQAMappings.xml";
private static final String XMLFILE = "SEUQAMappings.xml";
private static final String XSDFILE = "SearchEngineSchema.xsd";


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
*
* @author Alex
*/
public class Util {
class Util {

private static Logger logger = Logger.getLogger(Util.class.getName());

Expand Down

0 comments on commit 4692715

Please sign in to comment.