Problem while reading the File in a eclipse Plugin application
- by Abhishek Choudhary
I 've developed an eclipse plugin and in that I have a java file trying to read directories and then populate result accordingly.
When I try to run the file from eclipse itself through RunJava application , it gives me proper result but as soon as I try to run the same through Eclipse Application, it is throwing NullPointerException because unable to find the directory.
I tried the following ways-
Suppose , I have a package as -
Package - com.test.abhishek.file.java.TestWork.java
Directories - com.test.abhishek.file.java.Dir1
com.test.abhishek.file.java.Dir2
Now in TestWork.java-
InputStream is = LGHelpContentView.class.getResourceAsStream("/"+dirName);**
The above line is getting failed.
How should I keep my directory and where so that it will run as an eclipse plug-in as well.