Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

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

Jira Plugin storing files

Hi,

i have a Jira-Plugin, which provides the functionality to upload and access jar-files. Now im not really sure where to store this files.

- "java.io.tmpdir"?

- Blob@Database?

- ...

Whats the best practice for this?

Thanks in advance

Sebastian

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

2 votes
Answer accepted

Well, starting with what's not possible:

You can't use AO because it doesn't support byte[] and base64'ing JAR's is silly.

Storing Blobs is generally bad practice because the XML backup will not cover it. JIRA admins are not going to thank you for increasing the complexity of their restores.

What is possible:

Storing files in java.io.tmpdir may not exist longer term, if you want to persist data use JIRA_HOME/data, this is where attachments live and is where I also dump jemh/ data. This folder as part of JIRA_HOME is likely to receive backup attention by default. Creating a 'yourplugin/' folder would seem sensible, though, you need to consider management of those resources. Retaining a path reference in an AO table perhaps would be all that was needed.

To get a handle on JIRA_HOME, inject the type 'JiraHome', a new File pointing to that place can be gained with:

public MyDataService(JiraHome home) {
 fDataHome=new  
   File(home.getDataDirectory(),File.separatorChar+"myplugin");
 if (!fDataHome.exists())
 {
  fDataHome.mkdir();
 }
}

I suppose, like java resources, any resource folder should exist in a namespace folder tree, but I think on balance, the chances of collision in that location are slim.

Hi Andy,

thanks for your Reply. That really helped me out! :)

Greetings Sebastian

TAGS

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