title: Java android 10 probleme with create file
body: <p>private boolean checkPermissions() {
      listPermissionsNeeded = new ArrayList&lt;>();</p>
  
  <pre><code>int permissionRead = ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE);
  int permissionWrite = ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE);
  
  if (permissionRead != PackageManager.PERMISSION_GRANTED) {
      listPermissionsNeeded.add(Manifest.permission.READ_EXTERNAL_STORAGE);
  }
  if (permissionWrite != PackageManager.PERMISSION_GRANTED) {
      listPermissionsNeeded.add(Manifest.permission.WRITE_EXTERNAL_STORAGE);
  }
  
  if (!listPermissionsNeeded.isEmpty()) {
      ActivityCompat.requestPermissions(this, listPermissionsNeeded.toArray(new String[listPermissionsNeeded.size()]), REQUEST_ID_MULTIPLE_PERMISSIONS);
      return false;
  }
  return true;
  </code></pre>
  
  <p>}</p>
  
  <p>and </p>
  
  <pre><code>public static void parseBase64ToPDFAndNoOpen(String base64, String cardId) throws IOException {
  
      FileOutputStream os;
      File dwldsPath = new File(Environment.getExternalStorageDirectory() + "/" + File.separator + cardId + ".pdf");
      if (!dwldsPath.exists()) {
          dwldsPath.createNewFile();
          byte[] pdfAsBytes = Base64.decode(base64, 0);
          os = new FileOutputStream(dwldsPath, false);
          os.write(pdfAsBytes);
          os.flush();
          os.close();
      }
  }
  </code></pre>
  
  <p>On android 9 all works corretly but on andorid 10 I have this : java.io.IOException: Permission denied All permissions are granded</p>