title: unable to download the static xml file using spring Rest Controller
body: <p>Here is my code snippet when i test it from postman, getting the file content but i am expecting file to be downloaded as opening window .</p>
  
  <pre><code>@Override
    public ResponseEntity&lt;?&gt; downloadXmlFile() {
      try {
         String FILE_PATH =new ClassPathResource(ApplicationConstants.my_xml).getFile().getPath();
         File file = new File(FILE_PATH);
         InputStreamResource resource = new InputStreamResource(new FileInputStream(file));
           HttpHeaders headers = new HttpHeaders();
          headers.setContentType(MediaType.APPLICATION_PDF);
          headers.setContentDispositionFormData(file.getName(),file.getName());
          headers.setCacheControl("must-revalidate, post-check=0, pre-check=0");
           return new ResponseEntity&lt;InputStreamResource&gt;(resource,headers, HttpStatus.OK);
      } catch (Exception e) {
        LOG.error("Unexpected Exception occurred while serving the request" + e.getMessage());
        return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(new BaseResponse(AccredoStatusCode.INTERNAL_SERVER_ERROR));
      }
    }
  </code></pre>
  
  <p>Why I am getting file content instead of xml file to be downloaded?</p>