title: Read files from BOOT-INF/classes
body: <p>I have a Spring Boot application with a java resource folder: </p>
  
  <pre><code>src
   |
    main
     |
      resources
       |
        test
         |
          test1.json
          test2.json
          ...
  </code></pre>
  
  <p>In the resource folder there are json files. I can read these files within my IDE (IntelliJ). But as a compiled JAR file, I get <code>Nullpointer</code> exceptions.</p>
  
  <p>Spring Boot copies the files to: <code>BOOT-INF/classes/test</code> Is it possible to read the resource files within a JAR file? I don't know the file names. So in first, I have to get all file names and the read each file. </p>
  
  <p>Does anyone have an idea?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I have tried this:</p>
  
  <pre><code>Resources[] resources = applicationContext.getResources("classpath*:**/test/*.json");
  </code></pre>
  
  <p>With that I'm getting all file paths. But that needs too much time. And even if I get the file names, how would I read the files? </p>