title: Saving files to SD card on Android Lollipop
body: <p>Android 5 introduce new API for working with SD-card. If you want to write files into some directory on the SC-card, y need get access to it.
  As far as I know, it could be done in this way:</p>
  
  <pre><code>Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT_TREE);
  startActivityForResult(intent, 42);
  </code></pre>
  
  <p>and then:</p>
  
  <pre><code>public void onActivityResult(int requestCode, int resultCode, Intent resultData) {
      if (resultCode == RESULT_OK) {
          Uri treeUri = resultData.getData();
  
          getActivity().getContentResolver().takePersistableUriPermission(treeUri,
                      Intent.FLAG_GRANT_READ_URI_PERMISSION |
                      Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
       }
  }
  </code></pre>
  
  <p>This code launch folder picker, and when folder is picked it requires permissions on the folder by it's Uri.</p>
  
  <p>But is it possible to get permissions on exact directory by it's path? Without using folder picker. I meant that I know directory, which I want get access, and I don't want to launch Folder Picker, because it will confuse user.</p>
  
  <p>How to open <code>DocumentFile</code> without user interaction?</p>