aboutsummaryrefslogtreecommitdiffstats
path: root/server/src
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2012-08-30 13:05:19 +0300
committerLeif Åstrand <leif@vaadin.com>2012-08-30 13:05:19 +0300
commit7411bd0456f6dca3f8c25a5050ea786f90c6af0f (patch)
treea94bee85aa9c8e4973dd93c1217fa7f58ffefcc2 /server/src
parent6d4c07fdd3bc6c7935047ea779d27707198abb6a (diff)
downloadvaadin-framework-7411bd0456f6dca3f8c25a5050ea786f90c6af0f.tar.gz
vaadin-framework-7411bd0456f6dca3f8c25a5050ea786f90c6af0f.zip
Refactor to enable implementing #7545 without changing the API
Diffstat (limited to 'server/src')
-rw-r--r--server/src/com/vaadin/server/AbstractClientConnector.java2
-rw-r--r--server/src/com/vaadin/server/DownloadStream.java7
-rw-r--r--server/src/com/vaadin/server/GlobalResourceHandler.java2
-rw-r--r--server/src/com/vaadin/ui/AbstractMedia.java2
4 files changed, 8 insertions, 5 deletions
diff --git a/server/src/com/vaadin/server/AbstractClientConnector.java b/server/src/com/vaadin/server/AbstractClientConnector.java
index fa127fa2aa..2f660a443d 100644
--- a/server/src/com/vaadin/server/AbstractClientConnector.java
+++ b/server/src/com/vaadin/server/AbstractClientConnector.java
@@ -572,7 +572,7 @@ public abstract class AbstractClientConnector implements ClientConnector {
ConnectorResource resource = (ConnectorResource) getResource(key);
if (resource != null) {
DownloadStream stream = resource.getStream();
- stream.writeTo(response);
+ stream.writeResponse(request, response);
return true;
} else {
return false;
diff --git a/server/src/com/vaadin/server/DownloadStream.java b/server/src/com/vaadin/server/DownloadStream.java
index 7bc8a17c03..0c00f96832 100644
--- a/server/src/com/vaadin/server/DownloadStream.java
+++ b/server/src/com/vaadin/server/DownloadStream.java
@@ -26,7 +26,6 @@ import java.util.Map;
import javax.servlet.http.HttpServletResponse;
-
/**
* Downloadable stream.
*
@@ -231,14 +230,18 @@ public class DownloadStream implements Serializable {
* redirect (302 Moved temporarily) is sent instead of the contents of this
* stream.
*
+ * @param request
+ * the request for which the response should be written
* @param response
* the wrapped response to write this download stream to
+ *
* @throws IOException
* passed through from the wrapped response
*
* @since 7.0
*/
- public void writeTo(WrappedResponse response) throws IOException {
+ public void writeResponse(WrappedRequest request, WrappedResponse response)
+ throws IOException {
if (getParameter("Location") != null) {
response.setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY);
response.setHeader("Location", getParameter("Location"));
diff --git a/server/src/com/vaadin/server/GlobalResourceHandler.java b/server/src/com/vaadin/server/GlobalResourceHandler.java
index 7038d51251..f3a72a0efc 100644
--- a/server/src/com/vaadin/server/GlobalResourceHandler.java
+++ b/server/src/com/vaadin/server/GlobalResourceHandler.java
@@ -116,7 +116,7 @@ public class GlobalResourceHandler implements RequestHandler {
+ " didn't produce any stream.");
}
- stream.writeTo(response);
+ stream.writeResponse(request, response);
return true;
}
diff --git a/server/src/com/vaadin/ui/AbstractMedia.java b/server/src/com/vaadin/ui/AbstractMedia.java
index 940d85a8b9..3f59b070b7 100644
--- a/server/src/com/vaadin/ui/AbstractMedia.java
+++ b/server/src/com/vaadin/ui/AbstractMedia.java
@@ -97,7 +97,7 @@ public abstract class AbstractMedia extends AbstractComponent {
URLReference reference = sources.get(sourceIndex);
ConnectorResource resource = (ConnectorResource) ResourceReference
.getResource(reference);
- resource.getStream().writeTo(response);
+ resource.getStream().writeResponse(request, response);
return true;
} else {
return super.handleConnectorRequest(request, response, path);