title: jersey rest and csv response
body: <p>I have created a rest call that responds back with the CSV file using Jersey.</p>
  
  <p>rest call code is: </p>
  
  <pre><code>@GET
  @Path("/ReportWithoutADEStatus")
  @Produces({ "application/ms-excel"})
  public Response generateQurterlyReport(){
      QuarterlyLabelReport quartLabelReport = new QuarterlyLabelReport();
      String fileLoc=quartLabelReport.generateQurterlyLblRep(false);
      File file=new File(fileLoc);
      return Response.ok(fileLoc,"application/ms-excel")
              .header( "Content-Disposition","attachment;filename=QuarterlyReport_withoutADE.csv")
              .build();
  }
  </code></pre>
  
  <p>The above code reads a csv file created in a temp location and responds that csv using rest call. This is perfectly working fine. But now the requirement has changed.
  stream the file content in memory and respond that in csv format from Rest API.<br>
  I have never done streaming to a file in memory and responding back the content in REST.</p>
  
  <p>Can somebody help me with this?</p>
  
  <p>Thanks in advance.</p>