title: Reading a JSON file in spring MVC
body: <p>I am using JAVA 8, Servlet 3.1 and springMVC without the <code>web.xml</code>. I have placed a <code>info.json</code> file in <code>src\main\resources\data</code>. There is a util class from which i am trying to read the file. No matter what path i give am unable to read it. i get below exception :</p>
  
  <blockquote>
    <p>java.nio.file.NoSuchFileException: WEB-INF\classes\data\info.json
            at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:79)
            at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)</p>
  </blockquote>
  
  <p>I am trying to read the file as below :</p>
  
  <pre><code>public static &lt;T&gt; T unMarshal(String json, Class&lt;T&gt; clazz) throws IOException, URISyntaxException {
  
          byte[] jsonData = Files.readAllBytes(Paths.get("WEB-INF\\classes\\data\\info.json"));
          return  objectMapper.readValue(jsonData, clazz);
      }
  </code></pre>
  
  <p>also tried paths like </p>
  
  <p><code>C:\\domain\\src\\main\\resources\\data\\info.json
  src\\main\\resources\\data\\info.json
  data\\info.json</code></p>
  
  <p>I have tried different paths also tried fully qualified path still unable to read it. Also tried <a href="https://stackoverflow.com/questions/4340653/file-path-to-resource-in-our-war-web-inf-folder">File path to resource in our war/WEB-INF folder?</a> but unable to get hold of the context instance. Kindly suggest.</p>