Create New file inside selected package in a project from plugin
Answered
Hi All,
I am new to idea plugin development. I am trying to create a new file and write some data dynamically in the same package as the selected file. I tried to achieve this by using Java.IO File methods but i am getting security exception. Can anyone help me with - How i can achieve this?
Please sign in to leave a comment.
Sarika,
Please check our documentation pages related to the Virtual Files.
Hi Jakub,
I am already getting file path using Virtual File and able to read the content of file. Now i am trying to create a new file in project directory using java.io operations as mentioned in the link provided by you but i am getting "java.security.PrivilegedActionException: java.io.FileNotFoundException". I went through idea development tutorials but it does not mention about providing any permissions to avid these errors. Is there anything i can do to overcome this exception.
Looks like you have no privileges to create a new file in the given path. Check if the path is correct.