Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

Getting a static source URI for FileResource for the session

Oleksiy Tataryn
7 years ago Jul 01, 2015 3:23pm

rigth now every time I do a

new FileResource("/somewhere/something");

I get a an object with a different URI. As a result I get images that cannot be cached and are downloaded evey time.

Is there a way to override the resource servlet logic so that within one session FileResources created from same file get the same URI?