Showing an image from local directory

I would like to show an image from a local directory through vaadin into the web browser. The reason behind this is because Java talks with R to, based on a user selection, generate a particular image which is stored in a local folder which vaadin can access it.
Then vaadin can read or access the image file and represent it to the browser.

However I only find some basic information on Vaadin 8 and images but this does not seem to work in Vaadin 10.

                Image image1 = new Image("file://" + image, "");
                image1.setWidth("240px");
                image1.setHeight("240px");
                image1.getStyle().set("borderRadius", "50%");
				ui.access(() -> view.add(image1));

Are there other methods that needs to be applied before the image can be visualized?

Hi Jasper,

There’s an example in the docs: https://vaadin.com/docs/v10/flow/advanced/tutorial-dynamic-content.html

I don’t know if images served this way are cached by the client/browser. If caching images are important, it may be better to store the file in a directory that is accessible directly from the server and add expires tags using a filter if necessary.