示例#1
0
文件: Case.java 项目: halbbob/autopsy
 /**
  * Gets the time zone(s) of the image(s) in this case.
  *
  * @return time zones the set of time zones
  */
 public Set<TimeZone> getTimeZone() {
   Set<TimeZone> timezones = new HashSet<TimeZone>();
   for (Content c : getRootObjects()) {
     try {
       final Image image = c.getImage();
       if (image != null) {
         timezones.add(TimeZone.getTimeZone(image.getTimeZone()));
       }
     } catch (TskException ex) {
       logger.log(Level.INFO, "Error getting time zones", ex);
     }
   }
   return timezones;
 }
示例#2
0
  public static TimeZone getTimeZone(Content c) {

    try {
      if (!shouldDisplayTimesInLocalTime()) {
        return TimeZone.getTimeZone("GMT");
      } else {
        final Content dataSource = c.getDataSource();
        if ((dataSource != null) && (dataSource instanceof Image)) {
          Image image = (Image) dataSource;
          return TimeZone.getTimeZone(image.getTimeZone());
        } else {
          // case such as top level VirtualDirectory
          return TimeZone.getDefault();
        }
      }
    } catch (TskException ex) {
      return TimeZone.getDefault();
    }
  }