I found this file exist in the url showed, but still get NoSuchFileException. Had try many way but the path return always same, but cant read the file. How it will be? It there but not there? why plz?
public void readFile() throws IOException {
String fileName = "domain.txt";
ClassLoader classLoader = getClass().getClassLoader();
File file = new File(classLoader.getResource(fileName).getFile());
//File is found
System.out.println("File Found : " + file.exists());
//Read File Content
String content = new String(Files.readAllBytes(file.toPath()));
System.out.println(content);
}