diff options
author | Leif Åstrand <leif@vaadin.com> | 2012-11-22 11:52:31 +0200 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2012-11-22 11:52:40 +0200 |
commit | 7fb247173e34e445e13fcec76b30246be8799791 (patch) | |
tree | cddfd839024e6e3dcf30fc9e0f4d4eb60182f3fd /server | |
parent | de1450300bcc83eb3f6eddcd39bd77e02b24dfeb (diff) | |
download | vaadin-framework-7fb247173e34e445e13fcec76b30246be8799791.tar.gz vaadin-framework-7fb247173e34e445e13fcec76b30246be8799791.zip |
Add FileDownloader.setFileDownloadResource (#10203)
Change-Id: I1dfcf01af6b4b4a9fa30699dc96dfdb2826b23a8
Diffstat (limited to 'server')
-rw-r--r-- | server/src/com/vaadin/server/FileDownloader.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/server/src/com/vaadin/server/FileDownloader.java b/server/src/com/vaadin/server/FileDownloader.java index a5f450c28b..1df197bada 100644 --- a/server/src/com/vaadin/server/FileDownloader.java +++ b/server/src/com/vaadin/server/FileDownloader.java @@ -80,6 +80,17 @@ public class FileDownloader extends AbstractExtension { } /** + * Sets the resource that is downloaded when the extended component is + * clicked. + * + * @param resource + * the resource to download + */ + public void setFileDownloadResource(Resource resource) { + setResource("dl", resource); + } + + /** * Sets whether the content type of served resources should be overriden to * <code>application/octet-stream</code> to reduce the risk of a browser * plugin choosing to display the resource instead of downloading it. This |