Check if file exists in internal directory
<p>Im checking if a file excists in a directory. If not it should download it.</p>

<pre><code>    File file = new File(mediadir, _name);

    if(file.exists()) {
        Log.i("FILE EXISTS", _name);
    } else {
        Log.i("DOWNLOAD", _name);
        new Download().execute(context, name, "http://192.168.2.136:8080/rest/transfer/"+ linkid +"/"+ username +"/" + json_data.getString("ID"));
}
</code></pre>

<p>But <strong>file.exists()</strong> is always <strong>true</strong></p>

<p><em>the file does not exists on there</em></p>

<p>I run this right before the file.exists()</p>

<pre><code>        File mediadir = getDir("tvr", Context.MODE_PRIVATE);
        if (mediadir.isDirectory()) {
            String[] children = mediadir.list();
            for (int i = 0; i &lt; children.length; i++) {
                new File(mediadir, children[i]).delete();
            }
        }
</code></pre>
