From aacd6d99bace2b17e2694be69ea7bdab2d43c38e Mon Sep 17 00:00:00 2001 From: millmanorama Date: Thu, 23 Aug 2018 11:57:35 +0200 Subject: [PATCH] a bit more cleanup --- .../autopsy/recentactivity/Chrome.java | 24 ++++++++----------- .../autopsy/recentactivity/Util.java | 4 ++-- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/Chrome.java b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/Chrome.java index 876e9bc69f..2cff40124d 100644 --- a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/Chrome.java +++ b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/Chrome.java @@ -589,9 +589,10 @@ final class Chrome extends Extract { List> tempList = this.dbConnect(temps, LOGIN_QUERY); logger.log(Level.INFO, "{0}- Now getting login information from {1} with {2}artifacts identified.", new Object[]{getModuleName(), temps, tempList.size()}); //NON-NLS for (HashMap result : tempList) { - Collection bbattributes = Arrays.asList(new BlackboardAttribute( - TSK_URL, PARENT_MODULE_NAME, - Objects.toString(result.get("origin_url"), "")), //NON-NLS + Collection bbattributes = Arrays.asList( + new BlackboardAttribute( + TSK_URL, PARENT_MODULE_NAME, + Objects.toString(result.get("origin_url"), "")), //NON-NLS new BlackboardAttribute( TSK_DATETIME_ACCESSED, PARENT_MODULE_NAME, (Long.valueOf(result.get("last_visit_time").toString()) / 1000000) - SECONDS_SINCE_JAN_1_1601), //NON-NLS @@ -624,23 +625,18 @@ final class Chrome extends Extract { this.getModuleName(), signonFile.getName())); } - // Don't add TSK_OS_ACCOUNT artifacts to the ModuleDataEvent - //TODO: Why not? Because it has a different artifact type? We can just post it seperately? + Set osAccountAttriubtes = Collections.singleton( + new BlackboardAttribute( + TSK_USER_NAME, PARENT_MODULE_NAME, + Objects.toString(result.get("username_value"), "").replaceAll("'", "''")));//NON-NLS try { - BlackboardAttribute osAcctAttribute = new BlackboardAttribute(TSK_USER_NAME, PARENT_MODULE_NAME, - Objects.toString(result.get("username_value"), "").replaceAll("'", "''")); //NON-NLS BlackboardArtifact osAccountArtifact = signonFile.newArtifact(TSK_OS_ACCOUNT); - osAccountArtifact.addAttributes(Collections.singleton(osAcctAttribute)); - - blackboard.postArtifact(osAccountArtifact, PARENT_MODULE_NAME); - + osAccountArtifact.addAttributes(osAccountAttriubtes); + bbartifacts.add(osAccountArtifact); } catch (TskCoreException ex) { logger.log(Level.SEVERE, "Error while trying to insert Chrome os account artifact.", ex); //NON-NLS this.addErrorMessage(NbBundle.getMessage(Chrome.class, "Chrome.getLogin.errMsg.errAnalyzingFiles", this.getModuleName(), signonFile.getName())); - } catch (Blackboard.BlackboardException ex) { - logger.log(Level.SEVERE, "Error while trying to post Chrome os account artifact.", ex); //NON-NLS - this.addErrorMessage(Bundle.Extractor_errPostingArtifacts(getModuleName())); } } diff --git a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/Util.java b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/Util.java index 0b4f619bc0..69fa91c98f 100644 --- a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/Util.java +++ b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/Util.java @@ -83,7 +83,7 @@ class Util { } public static String getBaseDomain(String url) { - //TODO: There is no utility in apache or guave to do this for us? + //JIRA-2384: There is no utility in apache or guave to do this for us? //strip protocol String cleanUrl = url.replaceFirst(".*:\\/\\/", ""); @@ -112,7 +112,7 @@ class Util { public static String extractDomain(String value) { - //TODO: There is no utility in apache or guave to do this for us? + //JIRA-2384: There is no utility in apache or guave to do this for us? if (value == null) { return "";