@NonNull
    public static String toUserDisplayableString(final Uri uri) {

        if (uri == null) {
            return "---";
        }
        //Handle special File case
        if (isFileUri(uri)) {
            return uri.getPath();
        }

        String uriString = uri.getLastPathSegment();
        if (uriString == null) {
            return "---";
        }

        //handle the non-content-case (e.g. web Uris)
        if (!isContentUri(uri)) {
            return uri.toString();
        }

        String volumeId = null;
        //check if there'sa volume
        final int idx = uriString.indexOf(":");
        if (idx >= 0) {
            volumeId = uriString.substring(0, idx);
            uriString = uriString.substring(idx + 1);
        }

        //construct base Uri
        while (uriString.startsWith("/")) {
            uriString = uriString.substring(1);
        }
        uriString = "/" + uriString;

        //add volumne name if available/feasible
        if (volumeId != null) {
            final String volumeName = VOLUME_MAP.get(volumeId);
            if (volumeName != null) {
                uriString = volumeName + uriString;
            } else if (!"primary".equals(volumeId)) {
                uriString = volumeId + uriString;
            }
        }

        //add provider info if available/feasible
        final String providerId = uri.getAuthority();
        //default provider would be "com.android.externalstorage.documents", we don't add anything for this one
        if ("com.android.providers.downloads.documents".equals(providerId)) {
            uriString = "Downloads:" + uriString;
        }

        while (uriString.endsWith("/")) {
            uriString = uriString.substring(0, uriString.length() - 1);
        }

        return uriString;
    }
Tries to format the given Uri in a user-displayable way
main/src/main/java/cgeo/geocaching/utils/UriUtils.java