title: Java.io.FileNotFoundException when downloading file
body: <p>I can't figure out whats the problem here, it used to work but not anymore. I am trying to download a file from an url. It seems i am not properly creating the file.</p>
  
  <pre><code>            static String PATH = Environment.getExternalStorageDirectory() + "/Android/data/com.xxxx.xxxx/";
              url = new URL("http://xxxxxxx.xxx/file.apk");
              HttpURLConnection c = (HttpURLConnection) url.openConnection();
              c.setRequestMethod("GET");
              c.setDoOutput(false);
              c.connect();
  
  
              File file = new File(PATH);
              File outputFile = new File(file, "update"+separated[1]+".apk");
  
              //it crashes at this point
  
              FileOutputStream fos = new FileOutputStream(outputFile);
  
              InputStream is = c.getInputStream();
  
              byte[] buffer = new byte[1024];
              int len1 = 0;
              while ((len1 = is.read(buffer)) != -1) {
                  fos.write(buffer, 0, len1);
              }
              fos.close();
              is.close();
  
  
   java.io.FileNotFoundException: /storage/emulated/0/Android/data/com.xxxxx.xxx/update150.apk: open failed: ENOENT (No such file or directory)
      at libcore.io.IoBridge.open(IoBridge.java:409)
      at java.io.FileOutputStream.&lt;init&gt;(FileOutputStream.java:88)
      at java.io.FileOutputStream.&lt;init&gt;(FileOutputStream.java:73)
      at com.sanisidrolsa.appterris.GcmIntentService.onHandleIntent(GcmIntentService.java:67)
      at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
      at android.os.Handler.dispatchMessage(Handler.java:102)
      at android.os.Looper.loop(Looper.java:136)
      at android.os.HandlerThread.run(HandlerThread.java:61)
   Caused by: libcore.io.ErrnoException: open failed: ENOENT (No such file or directory)
      at libcore.io.Posix.open(Native Method)
      at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
      at libcore.io.IoBridge.open(IoBridge.java:393)
      ... 7 more
  </code></pre>