InputStream in = this.getClass().getClassLoader().getResourceAsStream("TextFile.txt");
InputStream in = this.getClass().getResourceAsStream("/TextFile.txt");
package dummy;
import java.io.*;
public class Test
{
public static void main(String[] args)
{
InputStream stream = Test.class.getResourceAsStream("/TextFile.txt");
System.out.println(stream != null);
stream = Test.class.getClassLoader().getResourceAsStream("TextFile.txt");
System.out.println(stream != null);
}
}