summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1589.java2
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2292.java2
6 files changed, 10 insertions, 7 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);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1589.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1589.java
index b1b652381f..37f9197285 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1589.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1589.java
@@ -91,7 +91,7 @@ class MyDynamicResource implements RequestHandler {
downloadStream.setParameter("Content-Disposition",
"attachment; filename=\"downloadedPNG.png\"");
}
- downloadStream.writeTo(response);
+ downloadStream.writeResponse(request, response);
return true;
} catch (IOException e) {
return false;
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2292.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2292.java
index c4c600edaa..1e7fe5d78a 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2292.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2292.java
@@ -87,7 +87,7 @@ public class Ticket2292 extends com.vaadin.Application.LegacyApplication
// Return a stream from the buffer.
ByteArrayInputStream istream = new ByteArrayInputStream(
imagebuffer.toByteArray());
- new DownloadStream(istream, null, null).writeTo(response);
+ new DownloadStream(istream, null, null).writeResponse(request, response);
return true;
} catch (IOException e) {
return false;