code: public static File getFile(Context context, Uri uri) {
          if (uri != null) {
              String path = getPath(context, uri);
              if (path != null && isLocal(path)) {
                  return new File(path);
              }
          }
          return null;
      }
docs: Convert Uri into File, if possible.
  
  @return file A local file that the Uri was pointing to, or null if the
  Uri is unsupported or pointed to a remote resource.
  @see #getPath(Context, Uri)
  @author paulburke