diff options
author | Martín López <mlopez@flowingcode.com> | 2020-05-08 13:50:20 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-08 19:50:20 +0300 |
commit | dbfa4cf3f31a9decff2c463494f32ff8f3126f29 (patch) | |
tree | 367b94a7aae0b6ba473658a6f0720d9089c894cb /documentation | |
parent | 8821d64a15c0200d920ac94da844568ed0034306 (diff) | |
download | vaadin-framework-dbfa4cf3f31a9decff2c463494f32ff8f3126f29.tar.gz vaadin-framework-dbfa4cf3f31a9decff2c463494f32ff8f3126f29.zip |
Fixed a problem with example code in article "Letting The User Download A File" (#11971)
Fixes #10580
Diffstat (limited to 'documentation')
-rw-r--r-- | documentation/articles/LettingTheUserDownloadAFile.asciidoc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/documentation/articles/LettingTheUserDownloadAFile.asciidoc b/documentation/articles/LettingTheUserDownloadAFile.asciidoc index f977b07956..1ede8bd5c0 100644 --- a/documentation/articles/LettingTheUserDownloadAFile.asciidoc +++ b/documentation/articles/LettingTheUserDownloadAFile.asciidoc @@ -104,8 +104,15 @@ public class OnDemandFileDownloader extends FileDownloader { return super.handleConnectorRequest(request, response, path); } - private StreamResource getResource () { - return (StreamResource) this.getResource("dl"); + private StreamResource getResource() { + StreamResource result = null; + this.getSession().lock(); + try { + result = (StreamResource) this.getResource("dl"); + } finally { + this.getSession().unlock(); + } + return result; } } .... |