Using velocity to display all images in a directory in JIRA

Jason Richardson August 15, 2011

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

1 answer

0 votes
m@
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 15, 2011

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.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events