Java: constructing a file from a URI?
<p>I need to obtain a File object from a URI, working in Java, but keep getting a length of zero - though I know the file size is not zero. </p>

<p>I need the File object to pass to <a href="http://code.google.com/apis/gdata/javadoc/com/google/gdata/data/media/MediaFileSource.html#constructor_summary" rel="nofollow">another constructor</a>.</p>

<p>I'm not sure if it's because I'm constructing it in the wrong way? Here's my code:</p>

<pre><code>    File videoFile = new File(videoURI.getPath());
    if (videoFile == null) {
        Log.d(LOG_TAG, "File not found!");
        return false;
    }

    Log.d(LOG_TAG, "about to upload, filepath: " + videoFile.getPath());

    Log.d(LOG_TAG, "File length: " + String.valueOf(videoFile.length()));
</code></pre>

<p>The log output doesn't spit out 'File not found!', and prints a non-null path, but shows a length of 0. </p>
