From 167f96de993360a6bdf1a911dac718ad0d6c4ad7 Mon Sep 17 00:00:00 2001 From: Maxime Biais Date: Wed, 9 Sep 2015 12:18:46 +0200 Subject: [PATCH] new UrlUtils method: appendPreviewURLParameter --- .../src/main/java/org/wordpress/android/util/UrlUtils.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/WordPressUtils/src/main/java/org/wordpress/android/util/UrlUtils.java b/WordPressUtils/src/main/java/org/wordpress/android/util/UrlUtils.java index 7ac4dbaf089d..c2529526a898 100644 --- a/WordPressUtils/src/main/java/org/wordpress/android/util/UrlUtils.java +++ b/WordPressUtils/src/main/java/org/wordpress/android/util/UrlUtils.java @@ -10,7 +10,6 @@ import java.io.UnsupportedEncodingException; import java.net.IDN; import java.net.URI; -import java.net.URL; import java.net.URLDecoder; import java.net.URLEncoder; import java.nio.charset.Charset; @@ -214,4 +213,8 @@ public static boolean isImageUrl(String url) { return cleanedUrl.endsWith("jpg") || cleanedUrl.endsWith("jpeg") || cleanedUrl.endsWith("gif") || cleanedUrl.endsWith("png"); } + + public static String appendPreviewURLParameter(String url) { + return Uri.parse(url).buildUpon().appendQueryParameter("preview", "true").build().toString(); + } }