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?

0
3 comments

Sarika,

Please check our documentation pages related to the Virtual Files.

0
Avatar
Permanently deleted user

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.

0

Looks like you have no privileges to create a new file in the given path. Check if the path is correct.

0

Please sign in to leave a comment.