title: how to access shared file without grant permission for 'storage'
body: <p>with Nexus 5, os M 6.0.1, and in Camera app select a photo and do ‘share’. In the target app, it gets the Uri from the intent and the filePath.
  when do new FileInputStream(new File(pathToFile)) it throws: 
  open failed: EACCES (Permission denied)</p>
  
  <p>It is because of permission for ‘storage’ not granted, but don’t want ask user to specifically grant ‘storage’ permission. 
  Is there a different way to read the file without permission for ’storage’?</p>
  
  <p>This is how the file path is extracted:</p>
  
  <pre><code>if (Intent.ACTION_SEND.equals(action) &amp;&amp;  
      intent.hasExtra(Intent.EXTRA_STREAM)) {
  
  Uri uri = (Uri) intent.getParcelableExtra(Intent.EXTRA_STREAM);
  
  String filePath;
  
  Cursor cursor = null;
  final String column = "_data"; 
  final String[] projection = { column };
  try {
    cursor = context.getContentResolver().query(uri, projection, null, null,
                      null);
    if (cursor != null &amp;&amp; cursor.moveToFirst()) {
         final int column_index = cursor.getColumnIndexOrThrow(column);
         filePath = cursor.getString(column_index);           
    }
  } catch(Exception e){
    return getFilePathFromInputStream(context, uri);
  }
  finally {
              if (cursor != null)
                  cursor.close();
  }
  
  // upto here got filePath =   
     /storage/emulated/0/DCIM/Camera/IMG_20170326_184502.jpg
  
  boolean b = false;
  try{
     File f2 = new File(filePath);
     b = f2.exists();
  } catch(Exception e) {
     Log.e("+++ exception e:"+e.getMessage());
  } catch(Error e) {
     Log.e("+++ error e:"+e.getMessage());
  }
  
  // unto here no exception, then
  
  fileInputStream = new FileInputStream(new File(filePath));  //&lt;=== here throws
  
  java.io.FileNotFoundException: /storage/emulated/0/DCIM/Camera/IMG_20170326_184502.jpg: open failed: EACCES (Permission denied)
  </code></pre>