Autopsy  4.14.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
XRYFileParserFactory.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 
24 final class XRYFileParserFactory {
25 
40  static XRYFileParser get(String reportType) {
41  if (reportType == null) {
42  throw new IllegalArgumentException("Report type cannot be null");
43  }
44 
45  switch (reportType.trim().toLowerCase()) {
46  case "calls":
47  return new XRYCallsFileParser();
48  case "contacts/contacts":
49  case "contacts":
50  return new XRYContactsFileParser();
51  case "device/general information":
52  return new XRYDeviceGenInfoFileParser();
53  case "messages/sms":
54  return new XRYMessagesFileParser();
55  case "web/bookmarks":
56  return new XRYWebBookmarksFileParser();
57  default:
58  throw new IllegalArgumentException(reportType + " not recognized.");
59  }
60  }
61 
68  static boolean supports(String reportType) {
69  try {
70  //Attempt a get.
71  get(reportType);
72  return true;
73  } catch (IllegalArgumentException ex) {
74  return false;
75  }
76  }
77 
78  //Prevent direct instantiation
79  private XRYFileParserFactory() {
80  }
81 }

Copyright © 2012-2020 Basis Technology. Generated on: Wed Apr 8 2020
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.