List of utility methods to do URL Create
String | generateQueryJson(Map generate Query Json if (params == null || params.isEmpty()) return ""; JSONObject aJsonObject = new JSONObject(params); return aJsonObject.toString(); |
String | generateQueryString(Map generate Query String if (params == null) return ""; String aQueryParam = ""; if (params.size() > 0) { Set<String> aKeySet = params.keySet(); Iterator<String> aKeyIterator = aKeySet.iterator(); while (aKeyIterator.hasNext()) { String aParamName = aKeyIterator.next(); ... |
String | mapToQueryString( HashMap map To Query String StringBuilder sb = new StringBuilder(); try { for (HashMap.Entry<String, String> e : queryString.entrySet()) { if (sb.length() > 0) { sb.append('&'); sb.append(URLEncoder.encode(e.getKey(), "UTF-8")) .append('=') ... |
Map | buildQueries(String baseQuery, List build Queries Map<String, String> fqlByQueryIndex = new LinkedHashMap<String, String>(); for (int queryIndex = 0; queryIndex < datesByQueryIndex.size(); queryIndex++) { Date d = datesByQueryIndex.get(queryIndex); String query = baseQuery + convertToUnixTimeOneDayLater(d); fqlByQueryIndex.put(String.valueOf(queryIndex), query); return fqlByQueryIndex; |
Uri | buildEmailUri(String email, String subject, CharSequence body) To be used with android.content.Intent.ACTION_SENDTO to send email, either in plain text or HTML. StringBuilder builder = new StringBuilder(); builder.append("mailto:").append(email); builder.append("?subject=").append(subject); builder.append("&body=").append(body); String uriText = builder.toString().replace(" ", "%20"); return Uri.parse(uriText); |
String | url(String baseUrl, String relativePath) url if (relativePath == null || relativePath.length() == 0) { return relativePath; if (relativePath.contains("://") || relativePath.matches("(?s)^[a-zA-Z][a-zA-Z0-9+-.]*:.*$")) { return relativePath; if (relativePath.charAt(0) == '/') { ... |
String | url(String baseUrl, String relativePath) url if (relativePath == null || relativePath.length() == 0) { return relativePath; if (relativePath.contains("://")) { return relativePath; if (relativePath.charAt(0) == '/') { int index = baseUrl.indexOf("://"); ... |
String | createUrl(final String rootUrl, final String indivisualHost, final String featurePath, final int index, List create Url Uri.Builder builder = new Uri.Builder(); try { URI uri = new URI(rootUrl); String urlQuery = createQueryUrl(indivisualHost, featurePath, index, pairs); builder.scheme(uri.getScheme()); builder.authority(uri.getAuthority()); builder.path(uri.getPath() + "/"); ... |
String | buildBodyParameterString( List Shorthand for building a parameter string used in the body of POST requests return buildParameterString(parameters, ",", true); |
String | buildParameterString( List Builds a parameter string based on the given parameters, separated by given delimiter, and optionally quoted values if (parameters == null || parameters.isEmpty()) return ""; StringBuilder builder = new StringBuilder(); for (int i = 0; i < parameters.size(); i++) { String key = parameters.get(i).first; String value = parameters.get(i).second; if (value == null) continue; ... |