Hi,
I’ve posted here because I feel like Im being a newless clubie at the moment.
The class loading in the file is located at:
com\structures\gui\SteelDesigner.class
The file is located at:
com\structures\resources\UBProperties.csv
So my code is:
try {
File ubProperties = new File(this.getClass().getResource("../resources/UBProperties.csv").toString());
fileScanner = new Scanner(ubProperties);
} catch (FileNotFoundException ex) {
Logger.getLogger(UBTemplateBuilder.class.getName()).log(Level.SEVERE, null, ex);
}
and the output is:
02-May-2010 12:52:29 com.structures.elements.UBTemplateBuilder initTemplates
SEVERE: null
java.io.FileNotFoundException: file:\M:\Java%20Projects\BeamDesigner\build\classes\com\structures\resources\UBProperties.csv (The filename, directory name, or volume label syntax is incorrect)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.(FileInputStream.java:106)
at java.util.Scanner.(Scanner.java:636)
at com.structures.elements.UBTemplateBuilder.initTemplates(UBTemplateBuilder.java:34)
Now the directory in the exception is correct but claims it isnt…
I may be missing something stupid here but I’ve put this code together based on abunch of other examples, not any one so if anyone knows the best way to do what Im trying to do I would appriciate it.
By the way Im on Windows XP but of course want OS independancy.
Thanks,
Ken
