81 SimpleDateFormat formatter =
new SimpleDateFormat(
"MMMMM dd, yyyy");
86 HashMap<String, Object> snapShotContext =
new HashMap<>();
89 List<SubFilter> filters =
filter.getAndFilters();
91 for (SubFilter
filter : filters) {
92 if (
filter instanceof DateRangeFilter) {
93 long startDate = ((DateRangeFilter)
filter).getStartDate();
94 long endDate = ((DateRangeFilter)
filter).getEndDate();
98 snapShotContext.put(
"startTime", formatter.format(
new Date((Instant.ofEpochSecond(startDate)).toEpochMilli())));
102 snapShotContext.put(
"endTime", formatter.format(
new Date((Instant.ofEpochSecond(endDate)).toEpochMilli())));
104 }
else if (
filter instanceof AccountTypeFilter) {
106 Set<Account.Type> selectedAccounts = ((AccountTypeFilter)
filter).getAccountTypes();
107 ArrayList<ReportWriterHelper> fullAccountList =
new ArrayList<>();
108 for (Account.Type type : Account.Type.PREDEFINED_ACCOUNT_TYPES) {
109 if (type == Account.Type.CREDIT_CARD) {
113 fullAccountList.add(
new ReportWriterHelper(type.getDisplayName(), selectedAccounts.contains(type)));
116 snapShotContext.put(
"accounts", fullAccountList);
117 }
else if (
filter instanceof DeviceFilter) {
118 Collection<String> ids = ((DeviceFilter)
filter).getDevices();
119 ArrayList<ReportWriterHelper> list =
new ArrayList<>();
122 for (DataSource dataSource : sleuthkitCase.getDataSources()) {
123 boolean selected = ids.contains(dataSource.getDeviceId());
124 String dsName = sleuthkitCase.getContentById(dataSource.getId()).getName();
127 }
catch (TskCoreException ex) {
131 snapShotContext.put(
"devices", list);