Asela
(Asela Neligama)
March 25, 2011, 8:17am
1
Hi all,
Is there a way of obtaining the absolute path of a ThemeResource…??
I have a ThemeResource as follows.
I’m only able to get the relative path of it (images/next.png) & unable to get the absolute path at all.
ThemeResource nextIcon = new ThemeResource("images/next.png");
Any help is greatly appreciated.
Thanks in advance,
Asela.
Jouni1
(Jouni Koivuviita)
March 25, 2011, 1:08pm
2
Something like this could work:
getApplication().getContext().getBaseDirectory() + "/VAADIN/themes/" + getApplication().getTheme() + "/" + nextIcon.getResourceId()
mukthyar
(mukthyar azam)
November 12, 2011, 3:29pm
3
This one will give the absolute path of the event
[quote]
String basepath = getApplication().getContext().getBaseDirectory().getAbsolutePath();
[/quote]:blink:
Lorenzo22
(Lorenzo Sciuto)
June 17, 2013, 8:16am
4
what about this in Vaadin 7?! isn’t this just for 6?
Shadab
(Shadab Ambat)
July 10, 2014, 10:10pm
5
In Vaadin 7 - the only way I’ve found so far
String path = VaadinService.getCurrent().getBaseDirectory().getAbsolutePath() + "/VAADIN/themes/mytheme";
Thorsten38
(Thorsten Pottiez)
September 1, 2015, 9:09am
6
And how can I get the Path from the resources folder?
See attchahment
Bogdan21
(Bogdan Vasile)
December 28, 2016, 5:09pm
7
If you want to host your resources on a different server, as in https://vaadin.com/blog/-/blogs/optimizing-hosting-setup , try this approach:
String path = VaadinService.getCurrent().getDeploymentConfiguration().getResourcesPath() + "/VAADIN/themes/" + UI.getCurrent().getTheme() + "/" + specificResourcePath;