FileDownloader timeout ?

In my appication I used the FileDownloader extention to a button.
When the button is pressed the downloader build the required resource (it takes few seconds) and then download it.
Nothing happens (nor error nor file).
If I create a dumb resource it works e.g.
byte logData = “La vispa teresa etc…”.getBytes();
final byte dataLog = logData;
source = () → new BufferedInputStream(new ByteArrayInputStream(dataLog));
StreamResource resource = new StreamResource(source, “Import.log”);
but if I add a wait(5000L) to wait 5secs again nothing happens.
Is there a timeout in the FileDownloader ?
How can I change the situation ?
Tks