title: Java 8 : Get files from folder / subfolder
body: <p>I have this folders inside the resources folder of a <strong>SpringBoot</strong> app.</p>
  
  <pre><code>resources/files/a.txt
  resources/files/b/b1.txt
  resources/files/b/b2.txt
  resources/files/c/c1.txt
  resources/files/c/c2.txt
  </code></pre>
  
  <p>I want to get all the txt file, so this is my code:</p>
  
  <pre><code>   ClassLoader classLoader = this.getClass().getClassLoader();
     Path configFilePath = Paths.get(classLoader.getResource("files").toURI());   
  
     List&lt;Path&gt; atrackFileNames = Files.list(configFilePath)
                  .filter(s -&gt; s.toString().endsWith(".txt"))
                  .map(Path::getFileName)
                  .sorted()
                  .collect(toList());
  </code></pre>
  
  <p>But I only get the file <strong>a.txt</strong></p>