Eclipse getResourceAsStream returning null
Posted
by Chris
on Stack Overflow
See other posts from Stack Overflow
or by Chris
Published on 2010-02-03T21:07:26Z
Indexed on
2010/04/22
4:03 UTC
Read the original article
Hit count: 314
I cannot get getResourceAsStream to find a file. I have put the file in the top level dir, target dir, etc, etc and have tried it with a "/" in front as well. Everytime it returns null.
Any suggestions ? Thanks.
public class T {
public static final void main(String[] args) {
InputStream propertiesIS = T.class.getClassLoader().getResourceAsStream("test.txt");
System.out.println("Break");
}
}
© Stack Overflow or respective owner