Autopsy 4.22.1
Graphical digital forensics platform for The Sleuth Kit and other tools.
SnapShotReportWriter.java
Go to the documentation of this file.
1/*
2 * Autopsy Forensic Browser
3 *
4 * Copyright 2016 - 2019 Basis Technology Corp.
5 * Contact: carrier <at> sleuthkit <dot> org
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 */
19package org.sleuthkit.autopsy.timeline.snapshot;
20
21import java.awt.image.BufferedImage;
22import java.io.IOException;
23import java.nio.file.Path;
24import java.util.Date;
25import java.util.HashMap;
26import javax.imageio.ImageIO;
27import org.joda.time.format.DateTimeFormat;
28import org.sleuthkit.autopsy.casemodule.Case;
29import org.sleuthkit.autopsy.report.uisnapshot.UiSnapShotReportWriter;
30import org.sleuthkit.autopsy.timeline.zooming.EventsModelParams;
31
36
38 private final BufferedImage image;
39
57
63 @Override
64 protected void writeSnapShotHTMLFile() throws IOException {
65 //save the snapshot in the report directory
66 ImageIO.write(image, "png", getReportFolderPath().resolve("snapshot.png").toFile()); //NON-NLS
67
68 //make a map of context objects to resolve template paramaters against
69 HashMap<String, Object> snapShotContext = new HashMap<>();
70 snapShotContext.put("reportTitle", getReportName()); //NON-NLS
71 snapShotContext.put("startTime", zoomState.getTimeRange().getStart().toString(DateTimeFormat.fullDateTime())); //NON-NLS
72 snapShotContext.put("endTime", zoomState.getTimeRange().getEnd().toString(DateTimeFormat.fullDateTime())); //NON-NLS
73 snapShotContext.put("zoomState", zoomState); //NON-NLS
74
75 fillTemplateAndWrite("/org/sleuthkit/autopsy/timeline/snapshot/snapshot_template.html", "Snapshot", snapShotContext, getReportFolderPath().resolve("snapshot.html")); //NON-NLS
76 }
77}
UiSnapShotReportWriter(Case currentCase, Path reportFolderPath, String reportName, Date generationDate)
void fillTemplateAndWrite(final String templateLocation, final String templateName, Object context, final Path outPutFile)
SnapShotReportWriter(Case currentCase, Path reportFolderPath, String reportName, EventsModelParams zoomState, Date generationDate, BufferedImage snapshot)

Copyright © 2012-2024 Sleuth Kit Labs. Generated on:
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.