FileDownloader problem

Hello,
I can’t get FileDownloader working with
StreamResource.
Following code works fine:

        FileDownloader rejectedFileDownloader = new FileDownloader(new FileResource(new File(fileName))));
        rejectedFileDownloader.extend(myButton);  

but when I replace
FileResource
with following code:

        FileDownloader rejectedFileDownloader = new FileDownloader(new StreamResource(new StreamSource() {
            
            @Override
            public InputStream getStream() {
                try {
                    return new FileInputStream(fileName);
                } catch (FileNotFoundException e) {
                    return null;
                }
            }
        }, fileName));

nothing happens and when debugguging through
com.vaadin.server.ConnectorResourceHandler.handleRequest(VaadinSession, VaadinRequest, VaadinResponse)
requestPath is just
/UIDL/
.
The behaviour is the same with 7.1.10 as well as with 7.1.11 version. What do I wrong? Is it a bug?

Hi Agata,

it is the missing FileDownloader.extend() call.

It is (though it is not in code snippet); the only thing I have changed is replacing the
FileResource
with
StreamResource.

Problem was with the
fileName
- it was not a file name, but the file path.