It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to load a resource and use it's content?

Hey all together,

1.: I want to include a .txt (which has only names inside) file to my plugin resources.
2.: Then I want to use the content of this file to fill a table in a .vm (velocity template).
3.: Also I need to get the content in an file.

I tried it myself, but none of this works. I suppose it's because of an wrong path.
This is what I've done:


<atlassian-plugin key="${atlassian.plugin.key}" name="${}" plugins-version="2"> 
<param name="plugin-icon">images/pluginIcon.png</param>
<param name="plugin-logo">images/pluginLogo.png</param>

<!-- add our i18n resource -->
<resource type="i18n" name="i18n" location="VersionManager"/>
<!-- add our web resources -->
<web-resource key="VersionManager-resources" name="VersionManager Web Resources">
<resource type="download" name="VersionManager.css" location="css/VersionManager.css"/>
<resource type="download" name="VersionManager.js" location="js/VersionManager.js"/>
<resource type="download" name="images/" location="/images"/>
<resource type="download" name="projects" location="projectsData/projects.txt"/>
<resource type="download" name="date-picker" location="com.atlassian.auiplugin:aui-date-picker"/>



<!-- Add package to export here -->
<!-- Add package import here -->
<Import-Package>org.springframework.osgi.*;resolution:="optional", org.eclipse.gemini.blueprint.*;resolution:="optional", *</Import-Package>
<!-- Ensure plugin is spring powered -->



set (projectText = $projects)
<p id="projectsText"></p>

public void loadProjects() {

InputStream test1 = com.atlassian.core.util.ClassLoaderUtils.getResourceAsStream("org.springframework.osgi:projects", this.getClass());
URL test2 = getClass().getResource("projects");




0 answers

Suggest an answer

Log in or Sign up to answer

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you