title: Stream File at REST webservice and start print job on Desktop application
body: <p>I´ve created a webservice for getting a file:</p>
  
  <pre><code>@Stateless
  @Path("/print")
  public class PictureWebservice {
  
      @GET
      @Path("/startPrint")
      @Produces(MediaType.APPLICATION_OCTET_STREAM)
      public Response getFile() {
  
          String path = "/mypath.JPG";
        File file = new File(path);
        return Response.ok(file, MediaType.APPLICATION_OCTET_STREAM)
            .header("Content-Disposition", "attachment; filename=\"" + file.getName() + "\"" ) //optional
            .build();
      }
  }
  </code></pre>
  
  <p>I will call from another PC (on which runs another Desktop application) the REST webservice because I need this file (or stream) for printing on this Desktop application.</p>
  
  <p>Here my workflow:</p>
  
  <p>1) Call webservice for getting file (an image) test.png</p>
  
  <p>2) The PC on which runs the Desktop application get the file (maybe stream?)</p>
  
  <p>3) The desktop application will start a print job in this PC</p>
  
  <p>First of all:</p>
  
  <p>1) How can I do this?</p>
  
  <p>2) Should I store the file on my Desktop application PC physically? Because I don´t need the file only for prinint?</p>
  
  <p>Can you help me, please.</p>