title: Writing a file in a directory
body: <pre><code>File dir = android.os.Environment.getDownloadCacheDirectory();
               file =  new File(dir + File.separator + "Music1.mp3");
               if (!file.exists()) {
                   file.getParentFile().mkdirs();
                   file.createNewFile(); 
                  }
  
               fos = new FileOutputStream(file);
               inputStream = urlConnection.getInputStream();
  </code></pre>
  
  <p>on <code>file.createNewFile ()</code> throws an exception:</p>
  
  <pre><code>System.err(275): java.io.IOException: Permission denied
  </code></pre>
  
  <p>How can i solve this Problem?</p>