Autopsy  4.5.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
Utils.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2017 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.communications;
20 
21 import java.time.ZoneId;
22 import java.time.ZoneOffset;
24 import org.sleuthkit.datamodel.Account;
25 
29 class Utils {
30 
31  private Utils() {
32  }
33 
34  static ZoneId getUserPreferredZoneId() {
35  ZoneId zone = UserPreferences.displayTimesInLocalTime() ? ZoneOffset.systemDefault() : ZoneOffset.UTC;
36  return zone;
37  }
38 
45  static final String getIconFileName(Account.Type type) {
46  if (type.equals(Account.Type.CREDIT_CARD)) {
47  return "credit-card.png";
48  } else if (type.equals(Account.Type.DEVICE)) {
49  return "image.png";
50  } else if (type.equals(Account.Type.EMAIL)) {
51  return "email.png";
52  } else if (type.equals(Account.Type.FACEBOOK)) {
53  return "facebook.png";
54  } else if (type.equals(Account.Type.INSTAGRAM)) {
55  return "instagram.png";
56  } else if (type.equals(Account.Type.MESSAGING_APP)) {
57  return "messaging.png";
58  } else if (type.equals(Account.Type.PHONE)) {
59  return "phone.png";
60  } else if (type.equals(Account.Type.TWITTER)) {
61  return "twitter.png";
62  } else if (type.equals(Account.Type.WEBSITE)) {
63  return "web-file.png";
64  } else if (type.equals(Account.Type.WHATSAPP)) {
65  return "WhatsApp.png";
66  } else {
67  //there could be a default icon instead...
68  throw new IllegalArgumentException("Unknown Account.Type: " + type.getTypeName());
69  }
70  }
71 
72 }

Copyright © 2012-2016 Basis Technology. Generated on: Tue Feb 20 2018
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.