title: How to store files in Android's cache directory?
body: <p>My goal is store temporary files in the directory returned by Context#getCacheDir().</p>
  
  <pre><code>/data/data/my.app/cache/somedir/foo.json
  </code></pre>
  
  <p>I presume I can just use java.io apis to write files there. But I'm not sure how to set permissions on files there because I would not be able to use Context#MODE_PRIVATE.</p>
  
  <p>The filename parameter to Context#openFileOutput and Context#openFileInput cannot accept input with path delimiters. Thus they are only useful for files created in directory:</p>
  
  <pre><code>/data/data/my.app
  </code></pre>