Access text file in a Plugin Project

This is how my project paths are set up. https://i.imgur.com/cWvixxK.jpg

Now I am trying to get the text from the file mappings.json. The red circle indicates my code. I keep getting a FileNotFoundException. I have tried variations of the filepath e.g. /dir/mappings.json , .\dir\mappings.json. None of these are working.

How can I access this file so that it's also a part of the final built plugin?

Edit: I found one potential problem, and fixed it. The folder was not designated as a resource, after that it's now being package, however my path is still incorrect.

Edit 2: Okay so I got it to work finally using the answer provided here. https://stackoverflow.com/questions/18717038/adding-resources-in-intellij-for-java-project

Message was edited by: Osama Rao

0
1 comment
Avatar
Permanently deleted user

Solution Found

0

Please sign in to leave a comment.