public static void putDownloadLocation(@NonNull UniFile location) { Uri uri = location.getUri(); putString(KEY_DOWNLOAD_SAVE_SCHEME, uri.getScheme()); putString(KEY_DOWNLOAD_SAVE_AUTHORITY, uri.getEncodedAuthority()); putString(KEY_DOWNLOAD_SAVE_PATH, uri.getEncodedPath()); putString(KEY_DOWNLOAD_SAVE_QUERY, uri.getEncodedQuery()); putString(KEY_DOWNLOAD_SAVE_FRAGMENT, uri.getEncodedFragment()); if (getMediaScan()) { CommonOperations.removeNoMediaFile(location); } else { CommonOperations.ensureNoMediaFile(location); } }
/** * Inspects a photo URI to determine if the photo URI represents a business. * * @param photoUri The URI to inspect. * @return Whether the URI represents a business photo or not. */ public static boolean isBusinessContactUri(Uri photoUri) { if (photoUri == null) { return false; } String encodedFragment = photoUri.getEncodedFragment(); return !TextUtils.isEmpty(encodedFragment) && encodedFragment.equals(String.valueOf(TYPE_BUSINESS)); }
/** * Removes the contact type information stored in the photo URI encoded fragment. * * @param photoUri The photo URI to remove the contact type from. * @return The photo URI with contact type removed. */ public static Uri removeContactType(Uri photoUri) { String encodedFragment = photoUri.getEncodedFragment(); if (!TextUtils.isEmpty(encodedFragment)) { Builder builder = photoUri.buildUpon(); builder.encodedFragment(null); return builder.build(); } return photoUri; }
private static Contact loadEncodedContactEntity(Uri uri, Uri lookupUri) throws JSONException { final String jsonString = uri.getEncodedFragment(); final JSONObject json = new JSONObject(jsonString);
if (parsed.getHost().equals("ggt.gaa.st") && parsed.getEncodedFragment() != null) { for (String param : parsed.getEncodedFragment().split("&")) { if (param.startsWith("url=")) { url = URLDecoder.decode(param.substring(4), "utf-8");