M
mcampo84
I am using NetBeans (5.0) to write an applet that requires reading from
an input file - for now let's call it "testInput.txt". In order to
read from the file I use a BufferedReader with the following code:
FileReader inputFile = new
FileReader(String.valueOf(cl.getResource(
"data/testInput.txt")));
BufferedReader in = new BufferedReader(inputFile);
I created a "data" subfolder in the "src" folder that NetBeans provides
and that's where testInput.txt resides (NetBeans bundles everything in
this folder into the jar when it compiles). When I run the program,
however, I get the following error:
java.io.FileNotFoundException:
<pathName>.<jarName>.jar!\testInput.txt
(The filename, directory name, or volume label syntax is
incorrect).
What is confusing me is that earlier in the same program, I read from
another file in the same directory - "testInput.xml" - and use the same
code as above, with "testInput.xml" replacing "testInput.txt".
Can anyone help me figure this one out?
an input file - for now let's call it "testInput.txt". In order to
read from the file I use a BufferedReader with the following code:
FileReader inputFile = new
FileReader(String.valueOf(cl.getResource(
"data/testInput.txt")));
BufferedReader in = new BufferedReader(inputFile);
I created a "data" subfolder in the "src" folder that NetBeans provides
and that's where testInput.txt resides (NetBeans bundles everything in
this folder into the jar when it compiles). When I run the program,
however, I get the following error:
java.io.FileNotFoundException:
<pathName>.<jarName>.jar!\testInput.txt
(The filename, directory name, or volume label syntax is
incorrect).
What is confusing me is that earlier in the same program, I read from
another file in the same directory - "testInput.xml" - and use the same
code as above, with "testInput.xml" replacing "testInput.txt".
Can anyone help me figure this one out?