title: How to get server base path to find and read a json
body: <p>I have this rest and I'm trying to mock some responses
  I'm working on a <strong>WebSphere</strong> server with <strong>Spring Boot</strong></p>
  
  <pre><code>@RequestMapping(method = RequestMethod.GET, value = "", produces = {MediaType.APPLICATION_JSON_VALUE, "application/hal+json"})
  public Resources&lt;String&gt; getAssemblyLines() throws IOException {
      String fullMockPath = servletContext.getContextPath() + "\\assets\\services-mocks\\assembly-lines\\get-assembly-lines.ok.json";
      List&lt;String&gt; result = new ArrayList&lt;String&gt;();
      result.add(fullMockPath);
  
      try {
          byte[] rawJson = Files.readAllBytes(Paths.get(fullMockPath));
          Map&lt;String, String&gt; mappedJson = new HashMap&lt;String, String&gt;();
          String jsonMock = new ObjectMapper().writeValueAsString(mappedJson);
          result = new ArrayList&lt;String&gt;();
          result.add(jsonMock);
      } catch (IOException e) {
          result.add("Not found");
          result.add(e.getMessage());
      }
  
      return new Resources&lt;String&gt;(result,
              linkTo(methodOn(this.getClass()).getAssemblyLines()).withSelfRel());
  }
  </code></pre>
  
  <p>I get </p>
  
  <blockquote>
    <p>FileNotFoundException</p>
  </blockquote>
  
  <p>Tired Tushinov's solution</p>
  
  <pre><code>System.getProperty("user.dir");
  </code></pre>
  
  <p>But that returns the PATH of my server, not of my document root (and yes, they're in different folders)</p>
  
  <p>How can understand my base path?</p>