private static String getMimeType(GoogleMediaItem mediaItem) {
    String guessedMimetype = guessMimeTypeFromFilename(mediaItem.getFilename());
    if (!Strings.isNullOrEmpty(guessedMimetype)) {
      return guessedMimetype;
    }

    if (!Strings.isNullOrEmpty(mediaItem.getMimeType())) {
      return mediaItem.getMimeType();
    }

    if (mediaItem.isPhoto()) {
      return DEFAULT_PHOTO_MIMETYPE;
    }
    return DEFAULT_VIDEO_MIMETYPE;
  }
Nearly identical variant of {@link Instant#parse} that, per RFC3339, is okay with either
offsets or "Z" indicator.
extensions/data-transfer/portability-data-transfer-google/src/main/java/org/datatransferproject/datatransfer/google/mediaModels/GoogleMediaItem.java