Re:Some java help needed!
| Newsgroups | gmane.comp.java.enhydra.barracuda.general |
|---|---|
| Message-ID | <[email protected]> |
Thanks, Diez.
After looking at the javadocs, I did the following:
Object obj = new Object();
try{
BufferedReader in =
new BufferedReader(new
FileReader
(obj.getClass().getClassLoader().getResourceAsStream("countries.txt")));
.....
....
}
What is wrong here? I get the following error message:
cannot resolve symbol
[javac] symbol : constructor FileReader (java.io.InputStream)
[javac] location: class java.io.FileReader
[javac] new BufferedReader(new
[javac] ^
[javac] 1 error
I have imported java.io.*.
Thanks,
Damar
>Hi,
>
>use <SomeClass>.getClassLoader().getResourceAsStream("countries.txt")
>and move it to <webapp>/WEB-INF/classes.
>
>Diez
>> If I want to avoid the absolute directory, for the convenience of
>> deployment in Tomcat, in which directory, should I place the
>> countries.txt file?