From dbfa4cf3f31a9decff2c463494f32ff8f3126f29 Mon Sep 17 00:00:00 2001 From: Martín López Date: Fri, 8 May 2020 13:50:20 -0300 Subject: Fixed a problem with example code in article "Letting The User Download A File" (#11971) Fixes #10580 --- documentation/articles/LettingTheUserDownloadAFile.asciidoc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'documentation') 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; } } .... -- cgit v1.2.3