Authenticated downloading

Hi …

I am working in something where only Authenticated users can download files.

So far I am using this piece of code:

FileResource resource = new FileResource(new File("/opt/system/Downloads/bigFile.tar.gz"));
       
Link link = new Link("Link to the image file", resource);
             
FileDownloader fileDownloader = new FileDownloader(resource);
fileDownloader.extend(link);

setContent(link);

FileDownloader is providing me a link like this:

http://localhost:8080/Testing/APP/connector/2/7/href/bigFile.tar.gz so my question is:
Considering that my login system is already working. how can I validade if the requester of this link above is logged in or not ?

Thanks

If you show that link only to a logged in user that you keep track of in the servlet session, it should work as you want. The connector URL you show should only work for that user who’s Vaadin UI is in that servlet session, and if your user logs off (or the session expires) then it should no longer work.

Yes, now it seems obvious …

thanks