title: How to create nested folders and file in Context.MODE_PRIVATE?
body: <p>I have a requirement where files and folders are required to be written in nested structure using <code>Context.MODE_PRIVATE</code>.</p>
  
  <p>I found that we can create file using <code>openFileOutput(FILENAME, Context.MODE_PRIVATE);</code> and was able to create files using this method.But later on I found that using this method I can not create a nested file structure i.e for</p>
  
  <pre><code>openFileOutput("foo/myText.txt", Context.MODE_PRIVATE);
  </code></pre>
  
  <p>exception is thrown:</p>
  
  <pre><code>java.lang.IllegalArgumentException: File foo/myText.txt contains a path separator
  </code></pre>
  
  <p>May be because it expects only a <code>fileName &amp; not a filepath</code> and also documentation says </p>
  
  <blockquote>
    <p>Open a private file associated with this Context's application package
    for writing.</p>
  </blockquote>
  
  <p>Then I found that <code>getFilesDir()</code> returns Context's application package where I can create files using the normal Java File I/O.But I don't know the permissions under which it is created i.e whether it is <code>MODE_APPEND</code>,<code>MODE_PRIVATE</code>,<code>MODE_WORLD_READABLE</code> or <code>MODE_WORLD_WRITEABLE</code>.</p>
  
  <p>So, I have following questions:-<br /></p>
  
  <ol>
  <li><p>How do I create nested file structure using openFileOutput() method under MODE_PRIVATE(if it's possible)?</p></li>
  <li><p>If openFileOutput() is not applicable to create a nested structure,then is it safe to use <code>getFilesDir()</code> and Java File I/O combination for my requirement? What is the permission for the files created using this way?</p></li>
  </ol>