Is there a velocity macro or code that allows me to display all images in a directory? I am trying to dynamically list images in a JIRA directory that we use to contain add on icons and other images. Can I call the java.io.File class from velocity and display the images and their urls?
The dirctory would be like the standard jira icons directory.
images/icons
For securiy reasons you cannot access the file system directly from velocity. If you need to do this you will need to write a webwork action and provide it as a plugin.
Take a look at the documentation on how to write a webwork plugin module here: http://confluence.atlassian.com/display/JIRADEV/Webwork+plugin+module
Once you have the webwork action working you can use java.io.File as you describe to find the images you want to list.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.