Allow the title.
How I can do it with Vaadin 14 Spring and Java.
I search a lot of Forum and do it all I can.
But that not works.
I Just do it works.
Cr. My senior.
public void download() throws FileNotFoundException {
InputStream inputStream = new FileInputStream(
new File("C:/Users/44606/Desktop/novel/QQ farm/CH 1 - 90.pdf"));
StreamResource resource = new StreamResource("123.pdf", () -> inputStream);
Anchor link = new Anchor(resource,"");
link.getElement().setAttribute("download", true);
link.add(new Button(new Icon(VaadinIcon.DOWNLOAD_ALT)));
add(link);
}