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
Community moderators have prevented the ability to post new answers.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.