How to store generated image in folder under /VAADIN

My code generates a .pgn file which i later want to use in css.

I am trying to store this generated image in a folder under /VAADIN… but not able to get the proper path to this folder to store this image.

or is there a better to do this?

I think you can check current working directory for your app. Having this you can see the relative path to the /VAADIN folder. Depending on your context, whether it’s production or development, you might get different working directory locations relative to your app location.

I dealt once with storing some files, and when I was developing on Mac, the working directory was in the .app package of the platform I was developing with, while on production it was ofcourse a somewhere in tomcat’s folder, I don’t remember exactly.

But if you find that location and work your way with a relative path you can rely on, that’s great. Absolute path would be the ultimate unfortunate way.

What do you mean by “not able to get the proper path to this folder”?

got it using

String path = VaadinServlet.getCurrent().getServletContext().getRealPath(“/VAADIN”)+/themes/folder_name;