Default ProgressBar

In my web the attachments are retrieved from a webservice and I need something to indicate the user that there’s something going on while retrieving the file.
First I was using a TemporaryFileDownloadResource and I got the default indeterminate ProgressBar while the file was being downloaded.

resource = new TemporaryFileDownloadResource(app, exportFileName, null, fileToExport); app.getPage().open(resource, null, false); But a part from using the deprecated open method, I sometimes had a problem with the ProgressBar: after the file was dowloaded, the Progress continued going on forever and making the page unusable. I couldn’t identify the problem causing that because it happened rarely, but I didn’t want it to happen at all.

I tried then another way to download the files, which is very similar to the one used by TemporaryFileDownloadResource:

[code]
Button attachmentButton = new Button(attachment.getFilename());

StreamResource resource = new StreamResource(new StreamResource.StreamSource() {
@Override
public InputStream getStream() {
try {
return new ByteArrayInputStream(getFile(fileId));
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
}, attachment.getFilename());
new FileDownloader(resource).extend(attachmentButton);
[/code]But with this solution I don’t get any ProgressBar at all. I’ve tried to add it so it would start before getFile and stop before returning, but it simply doesn’t show at all.

Anyone knows how can I make the ProgressBar appear? (using the Vaadin’s default would be great)
Thanks!