title: How to get all files in directory in the classpath
body: <p>Is there a way using <code>ResourceLoader</code> to get a list of "sub resources" in a directory in the jar?</p>
  
  <p>For example, given sources</p>
  
  <pre><code>src/main/resources/mydir/myfile1.txt
  src/main/resources/mydir/myfile2.txt
  </code></pre>
  
  <p>and using</p>
  
  <pre><code>@Autowired
  private ResourceLoader resourceLoader;
  </code></pre>
  
  <p>I can get to the directory</p>
  
  <pre><code>Resource dir = resourceLoader.getResource("classpath:mydir")
  dir.exists() // true
  </code></pre>
  
  <p>but not the files within the dir. If I could get the file, I could call <code>dir.getFile().listFiles()</code>, but</p>
  
  <pre><code>dir.getFile() // explodes with FileNotFoundException
  </code></pre>
  
  <p>But I can't find a way to get the "child" resources.</p>