public static File toFile(final Uri uri) {
        if (isFileUri(uri)) {
            return new File(uri.getPath());
        }
        return null;
    }
if given Uri is a file uri, then the corresponding file is returned. Otherwise null is returned
main/src/main/java/cgeo/geocaching/utils/UriUtils.java