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;
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.