This entire set of conditions is insane.

All of it can be simplified down into:

  return new FileOutputStream(getLocalFile(), !overwrite);

There is no need to racily stat for the file's existence before trying to setup the constructor call.