Hello,
in relation with
thread
I try to download a file from a server, which is not the vaadin server. I am not very familiar with streams and so on and I do not know how to do this. According the
OnDemandFileDownloader
my code looks something like this:
private class BaseOnDemandStreamResource
implements OnDemandStreamResource
{
@Override
public InputStream getStream()
{
try
{
return new FileInputStream( new File( getFilename() ) );
}
catch ( FileNotFoundException fnfe )
{
throw new RuntimeException( fnfe );
}
}
...
}
The "Problem"is that
getFilename()
is not a path on the vaadin server (local file system), it looks something like this: “http://MyServer/tempDok/20140218_153312154.pdf”. Therefore
new File()
throws a
FileNotFoundException
. Which input stream should I use? Or do I have to get first the file via ftp, place it on the vaadin server (local file system) and than I can use the
FileInputStream
?