title: How to open resource in new window in vaadin?
body: <p>I'm trying to generate a pdf in vaadin. My problem is that the generated pdf opens in the current window(browser tab). I tried:</p>
  
  <pre><code> String filename = contentDataName + ".pdf";
      StreamResource resource = new StreamResource(source, filename, vaadinApplication);
      resource.getStream().setContentType("application/pdf");
      resource.getStream().setFileName(filename);
      resource.getStream().setParameter("Content-Disposition", "attachment; filename=\"" + filename + "\"");
      resource.getStream().setParameter("Content-Length", Integer.toString(fopOutput.size()));
      resource.setCacheTime(5000);
      resource.setMIMEType("application/pdf");
  
      mainWindow.open(resource);
      mainWindow.open(resource, "_blank", true);
  </code></pre>
  
  <p>It doesn't work. What am i missing? I also tried </p>
  
  <pre><code>mainWindow.open(resource, "_blank");
  </code></pre>