Skip to content

Commit

Permalink
new UrlUtils method: appendPreviewURLParameter
Browse files Browse the repository at this point in the history
  • Loading branch information
maxme committed Sep 9, 2015
1 parent 577e025 commit 167f96d
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
}
}

0 comments on commit 167f96d

Please sign in to comment.