public static Uri toContentUri(final Context ctx, final Uri uri) {
        if (isContentUri(uri)) {
            return uri;
        }
        if (isFileUri(uri)) {
            return FileProvider.getUriForFile(ctx, ctx.getString(R.string.file_provider_authority), toFile(uri));
        }
        return null;
    }
Returns whether this Uri is a file Uri
main/src/main/java/cgeo/geocaching/utils/UriUtils.java