title: android - retrieve all files from /res/raw folder as File type
body: <p>How can I retrieve all the files in /res/raw folder as File?
  I have found <a href="https://stackoverflow.com/questions/6539715/android-how-do-can-i-get-a-list-of-all-files-in-a-folder#answer-20879359">this</a> solution, and "New Folder" value I have replaced with "res/raw" as you can see in the following code:</p>
  
  <pre><code>public File[] getRawFiles() {
          File sdCardRoot = Environment.getExternalStorageDirectory();
          File yourDir = new File(sdCardRoot, "res/raw");
          return yourDir.listFiles();
  }
  </code></pre>
  
  <p>When program is started, I get an exception on line <code>return yourDir.listFiles</code>:</p>
  
  <pre><code>Caused by: java.lang.NullPointerException: Attempt to get length of null array
  </code></pre>
  
  <p>How can I fix this, and what is correct path to "res/raw/" ?</p>