java.io.FileNotFoundException Access is denied and System cannot find specified route

Hi, I am trying to code a plugin that launches an application, and I was not able to load the fxml controller till I fixed it like it says another post I created:: https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000640524-fx-controller-classNotFoundException-plugin-development . Then I added the line of code that it is said in that post, that is: 

loader.setClassLoader(getClass().getClassLoader());

 

Then, in another class I have a WebViewer object that loads a file to show like this:

webEngine.load(getClass().getResource("/html/dt.html").toExternalForm());

the thing is that, I don't know why, this is reading from the folder /out/production/TaskAnnotationPlugin/html.dt.html instead of reading from src/html/dt.html,, and, for this reason, when I have to make changes on the html file, instead of reading and writing the one from /src, I update the one from /out.,, like this::

PrinterWriter pw = new PrinterWriter("out/production/TaskAnnotationPlugin/html/dt.html");

The problem is that since I added the line code that I was told in the other post,, this is not working and I am getting this error:

java.io.FileNotFoundException: out\production\TaskAnnotationPlugin\html\dt.html (The system cannot find the specified route) 
at java.io.FileOutputStream.open0(Native Method)
at java.io.FileOutputStream.open(FileOutputStream.java:270)
at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
at java.io.FileOutputStream.<init>(FileOutputStream.java:101)
at java.io.PrintWriter.<init>(PrintWriter.java:184)

....

and even if I locating the file to read (this one called dtt.html) in the same package of the class that is trying to read it, the error persists, but now saying that the Access is denied::

java.io.FileNotFoundException: dtt.html (Access denied)
at java.io.FileOutputStream.open0(Native Method)
at java.io.FileOutputStream.open(FileOutputStream.java:270)
at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
at java.io.FileOutputStream.<init>(FileOutputStream.java:101)
at java.io.PrintWriter.<init>(PrintWriter.java:184)

 

Do you know why I cannot read it now ?? could you help me please? Here i leave you the project code::

https://github.com/rafads7/TaskAnnotationPlugin

the class that tries to read is the /src/fxml/HTMLDiagramModifier.java,,,,, the one that tries to load the webview is /src/fxml/GUIController.java,,,and the one in charge of adding the line of code that I was told in the other post: /src/javafx/MainPluginApplication.java

0

Please sign in to leave a comment.