diff --git a/Core/src/org/sleuthkit/autopsy/communications/AccountsRootChildren.java b/Core/src/org/sleuthkit/autopsy/communications/AccountsRootChildren.java index 53cb4e06c3..4f7ad9a039 100644 --- a/Core/src/org/sleuthkit/autopsy/communications/AccountsRootChildren.java +++ b/Core/src/org/sleuthkit/autopsy/communications/AccountsRootChildren.java @@ -89,7 +89,7 @@ class AccountsRootChildren extends Children.Keys { this.commsManager = commsManager; this.filter = accountDeviceInstanceKey.getCommunicationsFilter(); setName(accountDeviceInstance.getAccount().getAccountUniqueID()); - setIconBaseWithExtension("org/sleuthkit/autopsy/communications/images/" + AccountUtils.getIconFileName(accountDeviceInstance.getAccount().getAccountType())); + setIconBaseWithExtension("org/sleuthkit/autopsy/communications/images/" + Utils.getIconFileName(accountDeviceInstance.getAccount().getAccountType())); } public AccountDeviceInstance getAccountDeviceInstance() { diff --git a/Core/src/org/sleuthkit/autopsy/communications/FiltersPanel.java b/Core/src/org/sleuthkit/autopsy/communications/FiltersPanel.java index 858567f8e0..df5b3132fe 100644 --- a/Core/src/org/sleuthkit/autopsy/communications/FiltersPanel.java +++ b/Core/src/org/sleuthkit/autopsy/communications/FiltersPanel.java @@ -20,7 +20,6 @@ package org.sleuthkit.autopsy.communications; import java.time.LocalDate; import java.time.ZoneId; -import java.time.ZoneOffset; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -31,7 +30,6 @@ import javax.swing.JCheckBox; import org.openide.explorer.ExplorerManager; import org.openide.nodes.AbstractNode; import org.sleuthkit.autopsy.casemodule.Case; -import org.sleuthkit.autopsy.core.UserPreferences; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.ThreadConfined; import org.sleuthkit.datamodel.Account; @@ -77,7 +75,7 @@ final public class FiltersPanel extends javax.swing.JPanel { applyFilters(); } - dateRangeLabel.setText("Date Range ( " + (UserPreferences.displayTimesInLocalTime() ? ZoneId.systemDefault().getId() : ZoneOffset.UTC.getId()) + "):"); + dateRangeLabel.setText("Date Range ( " + (Utils.getUserPreferredZoneId().getId() + "):"); } @Override @@ -111,7 +109,7 @@ final public class FiltersPanel extends javax.swing.JPanel { final JCheckBox jCheckBox = new JCheckBox( "
" + type.getDisplayName() + "
", true ); @@ -419,7 +417,7 @@ final public class FiltersPanel extends javax.swing.JPanel { } private DateRangeFilter getDateRangeFilter() { - ZoneId zone = UserPreferences.displayTimesInLocalTime() ? ZoneId.systemDefault() : ZoneOffset.UTC; + ZoneId zone = Utils.getUserPreferredZoneId(); long start = startDatePicker.isEnabled() ? startDatePicker.getDate().atStartOfDay(zone).toEpochSecond() : 0; long end = endDatePicker.isEnabled() ? endDatePicker.getDate().atStartOfDay(zone).toEpochSecond() : 0; return new DateRangeFilter(start, end); diff --git a/Core/src/org/sleuthkit/autopsy/communications/RelationShipNode.java b/Core/src/org/sleuthkit/autopsy/communications/RelationShipNode.java index 19002a0771..f92b89ee71 100644 --- a/Core/src/org/sleuthkit/autopsy/communications/RelationShipNode.java +++ b/Core/src/org/sleuthkit/autopsy/communications/RelationShipNode.java @@ -18,13 +18,10 @@ */ package org.sleuthkit.autopsy.communications; -import java.time.ZoneId; -import java.time.ZoneOffset; import java.util.TimeZone; import java.util.logging.Level; import org.apache.commons.lang3.StringUtils; import org.openide.nodes.Sheet; -import org.sleuthkit.autopsy.core.UserPreferences; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.datamodel.BlackboardArtifactNode; import org.sleuthkit.autopsy.datamodel.NodeProperty; @@ -39,6 +36,7 @@ import static org.sleuthkit.datamodel.BlackboardAttribute.ATTRIBUTE_TYPE.TSK_EMA import static org.sleuthkit.datamodel.BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PHONE_NUMBER_FROM; import static org.sleuthkit.datamodel.BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PHONE_NUMBER_TO; import static org.sleuthkit.datamodel.BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SUBJECT; +import static org.sleuthkit.datamodel.BlackboardAttribute.TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.DATETIME; import org.sleuthkit.datamodel.TimeUtilities; import org.sleuthkit.datamodel.TskCoreException; @@ -122,9 +120,9 @@ public class RelationShipNode extends BlackboardArtifactNode { BlackboardAttribute attribute = artifact.getAttribute(new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.fromID(attributeType.getTypeID()))); if (attribute == null) { return ""; - } else if (attributeType.getValueType() == BlackboardAttribute.TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.DATETIME) { - ZoneId zone = UserPreferences.displayTimesInLocalTime() ? ZoneOffset.systemDefault() : ZoneOffset.UTC; - return TimeUtilities.epochToTime(attribute.getValueLong(), TimeZone.getTimeZone(zone)); + } else if (attributeType.getValueType() == DATETIME) { + return TimeUtilities.epochToTime(attribute.getValueLong(), + TimeZone.getTimeZone(Utils.getUserPreferredZoneId())); } else { return attribute.getDisplayString(); } @@ -133,4 +131,5 @@ public class RelationShipNode extends BlackboardArtifactNode { return ""; } } + } diff --git a/Core/src/org/sleuthkit/autopsy/communications/AccountUtils.java b/Core/src/org/sleuthkit/autopsy/communications/Utils.java similarity index 87% rename from Core/src/org/sleuthkit/autopsy/communications/AccountUtils.java rename to Core/src/org/sleuthkit/autopsy/communications/Utils.java index 3c936ecc70..af8cd3f8b4 100644 --- a/Core/src/org/sleuthkit/autopsy/communications/AccountUtils.java +++ b/Core/src/org/sleuthkit/autopsy/communications/Utils.java @@ -18,14 +18,22 @@ */ package org.sleuthkit.autopsy.communications; +import java.time.ZoneId; +import java.time.ZoneOffset; +import org.sleuthkit.autopsy.core.UserPreferences; import org.sleuthkit.datamodel.Account; /** * Utility class with helpers for dealing with accounts. */ -class AccountUtils { +class Utils { - private AccountUtils() { + static ZoneId getUserPreferredZoneId() { + ZoneId zone = UserPreferences.displayTimesInLocalTime() ? ZoneOffset.systemDefault() : ZoneOffset.UTC; + return zone; + } + + private Utils() { } /**