title: Get a list of resources from classpath directory
body: <p>I am looking for a way to get a list of all resource names from a given classpath directory, something like a method <code>List&lt;String&gt; getResourceNames (String directoryName)</code>.</p>
  
  <p>For example, given a classpath directory <code>x/y/z</code> containing files <code>a.html</code>, <code>b.html</code>, <code>c.html</code> and a subdirectory <code>d</code>, <code>getResourceNames("x/y/z")</code> should return a <code>List&lt;String&gt;</code> containing the following strings:<code>['a.html', 'b.html', 'c.html', 'd']</code>.</p>
  
  <p>It should work both for resources in filesystem and jars.</p>
  
  <p>I know that I can write a quick snippet with <code>File</code>s, <code>JarFile</code>s and <code>URL</code>s, but I do not want to reinvent the wheel. My question is, given existing publicly available libraries, what is the quickest way to implement <code>getResourceNames</code>? Spring and Apache Commons stacks are both feasible.</p>