title: FileSystemResource is returned with content type json
body: <p>I have the following spring mvc method that returns a file:</p>
  
  <pre><code>@RequestMapping(value = "/files/{fileName}", method = RequestMethod.GET)
  public FileSystemResource getFiles(@PathVariable String fileName){
  
      String path="/home/marios/Desktop/";
  
      return new FileSystemResource(path+fileName);
  
  }
  </code></pre>
  
  <p>I expect a ResourceHttpMessageConverter to create the appropriate response with an octet-stream type according to its documentation:</p>
  
  <blockquote>
    <p>If JAF is not available, application/octet-stream is used.</p>
  </blockquote>
  
  <p>However although I correctly get the file without a problem, the result has <strong>Content-Type: application/json;charset=UTF-8</strong></p>
  
  <p>Can you tell me why this happens?</p>
  
  <p>(I use spring version 4.1.4. I have not set explicitly any message converters and I know that spring loads by default among others the ResourceHttpMessageConverter and also the MappingJackson2HttpMessageConverter because I have jackson 2 in my classpath due to the fact that I have other mvc methods that return json. </p>
  
  <p>Also if I use <code>HttpEntity&lt;FileSystemResource&gt;</code> and set manually the content type, or specify it with <code>produces = MediaType.APPLICATION_OCTET_STREAM</code> it works fine. </p>
  
  <p>Note also that in my request I do not specify any accept content types, and prefer not to rely on my clients to do that)</p>