Enumerating themes?

I’m looking for a way to allow the user to freely choose which theme he wants to use in the application.
Is there a simple way of enumerating all themes in the “themes” directory for an application?

ApplicationServlet contains a getThemeSource() method that returns the applications ThemeSource which in turn contains getThemes() for getting a list of all themes associated with the ThemeSource. To use this, however, you need to get a reference to the ApplicationServlet.

Another way of performing this is enumerating all directories under the WEB-INF/lib/themes directory. The location of this directory can be found by using yourApplication.getContext().getBaseDirectory()+“WEB-INF/lib/themes”