]> git.argeo.org Git - lgpl/argeo-commons.git/blobdiff - base/runtime/org.argeo.eclipse.ui.rap/src/main/java/org/argeo/eclipse/ui/specific/DownloadServiceHandler.java
Maven build working (without check-osgi)
[lgpl/argeo-commons.git] / base / runtime / org.argeo.eclipse.ui.rap / src / main / java / org / argeo / eclipse / ui / specific / DownloadServiceHandler.java
index a8e2c345de76a8208f5bb98a97ec00ebeb01e9fe..099596dee2e7c308332237187c00fb6fc8beac77 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2012 Mathieu Baudier
+ * Copyright (C) 2007-2012 Argeo GmbH
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -19,10 +19,11 @@ import java.io.IOException;
 
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpServletRequest;
 
 import org.argeo.ArgeoException;
-import org.eclipse.rwt.RWT;
-import org.eclipse.rwt.service.IServiceHandler;
+import org.eclipse.rap.rwt.RWT;
+import org.eclipse.rap.rwt.service.IServiceHandler;
 
 public class DownloadServiceHandler implements IServiceHandler {
 
@@ -32,16 +33,15 @@ public class DownloadServiceHandler implements IServiceHandler {
                this.provider = provider;
        }
 
-       public void service() throws IOException, ServletException {
+       public void service( HttpServletRequest request, HttpServletResponse response )  throws IOException, ServletException {
                // Which file to download?
-               String fileName = RWT.getRequest().getParameter("filename");
-               String fileId = RWT.getRequest().getParameter("fileid");
+               String fileName = request.getParameter("filename");
+               String fileId = request.getParameter("fileid");
 
                // Get the file content
                byte[] download = provider.getByteArrayFileFromId(fileId);
 
                // Send the file in the response
-               HttpServletResponse response = RWT.getResponse();
                response.setContentType("application/octet-stream");
                response.setContentLength(download.length);
                String contentDisposition = "attachment; filename=\"" + fileName + "\"";