In my Java project in netbeans I get a text files contents to populate some internal data structure using this:
InputStream PFile = this.getClass().getResourceAsStream("../../IISP Details/IISP.txt"); // Get File to create IISP's
String[] PStringArray = new Scanner(PFile, "UTF-8").useDelimiter("\\A").next().split("\\r?\\n");
But when I clean and build my project it isn't working.
Ideas?
Edit:
More info...
The code is called in the cs.analyser.gui.master package in the 'loadMaster' class.
The file is in cs.analyser.IISPDetails.
I can tell that it's not finding the file - are there any alternatives? Or anyways to make the file get bundled with it when I build it?