Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Path File web resource

gia01020304 February 17, 2019 edited

 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

 

1 answer

1 accepted

0 votes
Answer accepted
gia01020304 February 25, 2019

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;
}

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, loom, loom for training, loom for teaching, video training, async learning, online education, screen recording, loom tutorials, loom use cases, atlassian learning, team training tools, instructional video, virtual training tools

🛗 Elevate Your Training and Enablement with Loom

Join us June 26, 11am PT for a webinar with Atlassian Champion Robert Hean & Loom’s Brittany Soinski. Hear tips, stories, and get your burning questions answered. Learn how Loom makes training and enablement easier. Don’t miss it!

Register today
AUG Leaders

Atlassian Community Events