Thread.currentThread().getContextClassLoader().getResource()のサンプル
Javaコード
public void fileReadFunc() throws IOException{
File file = new File(Thread.currentThread().getContextClassLoader().getResource(“example.txt").getFile());
BufferedReader br = new BufferedReader(new FileReader(file));
String len = null;
if ((len=br.readLine())!=null){
System.out.println(len);
}
}