本文整理匯總了Java中com.facebook.internal.Utility.isWebUri方法的典型用法代碼示例。如果您正苦於以下問題:Java Utility.isWebUri方法的具體用法?Java Utility.isWebUri怎麽用?Java Utility.isWebUri使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.facebook.internal.Utility
的用法示例。
在下文中一共展示了Utility.isWebUri方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: validatePhotoForApi
import com.facebook.internal.Utility; //導入方法依賴的package包/類
private static void validatePhotoForApi(SharePhoto photo, Validator validator) {
if (photo == null) {
throw new FacebookException("Cannot share a null SharePhoto");
}
Bitmap photoBitmap = photo.getBitmap();
Uri photoUri = photo.getImageUrl();
if (photoBitmap == null) {
if (photoUri == null) {
throw new FacebookException(
"SharePhoto does not have a Bitmap or ImageUrl specified");
}
if (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");
}
}
}
示例2: validateLinkContent
import com.facebook.internal.Utility; //導入方法依賴的package包/類
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");
}
}
示例3: validatePhotoForNativeDialog
import com.facebook.internal.Utility; //導入方法依賴的package包/類
private static void validatePhotoForNativeDialog(SharePhoto photo, Validator validator) {
validatePhotoForApi(photo, validator);
if (photo.getBitmap() != null || !Utility.isWebUri(photo.getImageUrl())) {
Validate.hasContentProvider(FacebookSdk.getApplicationContext());
}
}
示例4: validatePhotoForWebDialog
import com.facebook.internal.Utility; //導入方法依賴的package包/類
private static void validatePhotoForWebDialog(SharePhoto photo, Validator validator) {
if (photo == null) {
throw new FacebookException("Cannot share a null SharePhoto");
}
Uri imageUri = photo.getImageUrl();
if (imageUri == null || !Utility.isWebUri(imageUri)) {
throw new FacebookException(
"SharePhoto must have a non-null imageUrl set to the Uri of an image " +
"on the web");
}
}