I have build jira plugin rest
I add file xml in resource>config>myfile.xml in my project
I add in atlassian-plugin.xml
<resource type="download" name="myfile.xml" location="/config/myfile.xml"/>
And in my file rest.java I don't know how to get the file path
I had resolved my problem by
InputStream isStream = getClass().getResourceAsStream("filename");
After that use function
public Document readFileXmlDeploy(InputStream is) throws Exception {
Document document = null;
DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder documentBuilder;
try {
documentBuilder = documentBuilderFactory.newDocumentBuilder();
document = documentBuilder.parse(is);
} catch (Exception e) {
throw e;
}
return document;
}
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.