title: file downloading in restful web services
body: <p>My requirement is, I should send a 10MB zip file to the client with a restful service. I found the code in forums that sending a <code>StreamingOutput</code> object is the better way, but how can I create a <code>StreamingOutput</code> object in the following code:</p>
  
  <pre class="lang-java prettyprint-override"><code>@Path("PDF-file.pdf/")
  @GET
  @Produces({"application/pdf"})
  public StreamingOutput getPDF() throws Exception {
    return new StreamingOutput() {
       public void write(OutputStream output) throws IOException, WebApplicationException      
       {
          try {
              //------
          } catch (Exception e) {
              throw new WebApplicationException(e);
          }
       }
    };
  }
  </code></pre>