com.facebook.internal.Utility.isWebUri()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(86)

本文整理了Java中com.facebook.internal.Utility.isWebUri()方法的一些代码示例,展示了Utility.isWebUri()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utility.isWebUri()方法的具体详情如下:
包路径:com.facebook.internal.Utility
类名称:Utility
方法名:isWebUri

Utility.isWebUri介绍

暂无

代码示例

代码示例来源:origin: facebook/facebook-android-sdk

private static void validateLinkContent(
  ShareLinkContent linkContent, Validator validator) {
  Uri imageUrl = linkContent.getImageUrl();
  if (imageUrl != null && !Utility.isWebUri(imageUrl)) {
    throw new FacebookException("Image Url must be an http:// or https:// url");
  }
}

代码示例来源:origin: facebook/facebook-android-sdk

private Attachment(UUID callId, Bitmap bitmap, Uri uri) {
  this.callId = callId;
  this.bitmap = bitmap;
  this.originalUri = uri;
  if (uri != null) {
    String scheme = uri.getScheme();
    if ("content".equalsIgnoreCase(scheme)) {
      isContentUri = true;
      shouldCreateFile = uri.getAuthority() != null &&
          !uri.getAuthority().startsWith("media");
    } else if ("file".equalsIgnoreCase(uri.getScheme())) {
      shouldCreateFile = true;
    } else if (!Utility.isWebUri(uri)) {
      throw new FacebookException("Unsupported scheme for media Uri : " + scheme);
    }
  } else if (bitmap != null) {
    shouldCreateFile = true;
  } else {
    throw new FacebookException("Cannot share media without a bitmap or Uri set");
  }
  attachmentName = !shouldCreateFile ? null : UUID.randomUUID().toString();
  attachmentUrl = !shouldCreateFile
      ? this.originalUri.toString()
      : FacebookContentProvider.getAttachmentUrl(
          FacebookSdk.getApplicationId(),
          callId,
          attachmentName);
}

代码示例来源:origin: facebook/facebook-android-sdk

private static void validatePhotoForApi(SharePhoto photo, Validator validator) {
  validatePhoto(photo);
  Bitmap photoBitmap = photo.getBitmap();
  Uri photoUri = photo.getImageUrl();
  if (photoBitmap == null && Utility.isWebUri(photoUri) && !validator.isOpenGraphContent()) {
    throw new FacebookException(
      "Cannot set the ImageUrl of a SharePhoto to the Uri of an image on the " +
        "web when sharing SharePhotoContent");
  }
}

代码示例来源:origin: facebook/facebook-android-sdk

private static void validatePhotoForNativeDialog(SharePhoto photo, Validator validator) {
  validatePhotoForApi(photo, validator);
  if (photo.getBitmap() != null || !Utility.isWebUri(photo.getImageUrl())) {
    Validate.hasContentProvider(FacebookSdk.getApplicationContext());
  }
}

代码示例来源:origin: facebook/facebook-android-sdk

if (Utility.isWebUri(uri)) {
  results[writeIndex] = uri.toString();
  latch.countDown();

相关文章