Autopsy  4.13.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
XRYReportProcessor.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 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  */
19 package org.sleuthkit.autopsy.datasourceprocessors.xry;
20 
21 import java.io.IOException;
22 import java.util.List;
23 import java.util.logging.Level;
25 import org.sleuthkit.datamodel.Content;
26 import org.sleuthkit.datamodel.TskCoreException;
27 
31 final class XRYReportProcessor {
32 
33  private static final Logger logger = Logger.getLogger(XRYReportProcessor.class.getName());
34 
46  static void process(XRYFolder folder, Content parent) throws IOException, TskCoreException {
47  //Get all XRY file readers from this folder.
48  List<XRYFileReader> xryFileReaders = folder.getXRYFileReaders();
49 
50  try {
51  for (XRYFileReader xryFileReader : xryFileReaders) {
52  String reportType = xryFileReader.getReportType();
53  if (XRYFileParserFactory.supports(reportType)) {
54  XRYFileParser parser = XRYFileParserFactory.get(reportType);
55  parser.parse(xryFileReader, parent);
56  } else {
57  logger.log(Level.WARNING, String.format("[XRY DSP] XRY File (in brackets) "
58  + "[ %s ] was found, but no parser to support its report type exists. "
59  + "Report type is [ %s ]", xryFileReader.getReportPath().toString(), reportType));
60  }
61  }
62  } finally {
63  try {
64  //Try to close all resources
65  for (XRYFileReader xryFileReader : xryFileReaders) {
66  xryFileReader.close();
67  }
68  } catch (IOException ex) {
69  logger.log(Level.WARNING, "[XRY DSP] Encountered I/O exception trying "
70  + "to close all xry file readers.", ex);
71  }
72  }
73  }
74 
75  //Prevent direct instantiation.
76  private XRYReportProcessor() {
77 
78  }
79 }

Copyright © 2012-2019 Basis Technology. Generated on: Tue Jan 7 2020
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.