+ public void openFile(String fileName, String fileId) {
+
+ // See RAP FAQ:
+ // http://wiki.eclipse.org/RAP/FAQ#How_to_provide_download_link.3F
+ // And forum discussion :
+ // http://www.eclipse.org/forums/index.php?t=msg&th=205487&start=0&S=43d85dacc88b505402420592109c7240
+
+ try {
+ if (log.isDebugEnabled())
+ log.debug("URL : " + createFullDownloadUrl(fileName, fileId));
+
+ URL url = new URL(createFullDownloadUrl(fileName, fileId));
+ PlatformUI.getWorkbench().getBrowserSupport()
+ .createBrowser("DownloadDialog").openURL(url);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ // These lines are useless in the current use case but might be
+ // necessary with new browsers. Stored here for memo
+ // response.setContentType("application/force-download");
+ // response.setHeader("Content-Disposition", contentDisposition);
+ // response.setHeader("Content-Transfer-Encoding", "binary");
+ // response.setHeader("Pragma", "no-cache");
+ // response.setHeader("Cache-Control", "no-cache, must-revalidate");