In general you can't do what you want - there is no API to get a File for an item described by a "content" URI because a content URI does not have to correspond with a file anyway.
In practice it is possible to get a File path for some content URIs:
as you describe, sometimes you can get lucky, and manipulate the content uri by changing the content scheme to a file scheme
If the content URI came from the Media store, then you can do a query to get the file path
public static String getPathnameFromMediaUri(Activity activity, Uri contentUri)
{
String[] projection = { MediaStore.Images.Media.DATA };
Cursor cursor = activity.managedQuery(contentUri, projection, null, null, null);
int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
cursor.moveToFirst();
return cursor.getString(column_index);
}
There are a whole host of other questions asking pretty much the same thing that provide further ideas (or slightly different working of the same ideas)