I'm trying to create a method which checks if a certain text file is empty, and if so it deletes it. However, the program seems to freeze for one reason or another when executing this part.
try {
BufferedReader in = new BufferedReader(new FileReader("File List.txt"));
String str;
while ((str = in.readLine()) == null) {
boolean success = (new File("File List.txt")).delete();
}
in.close();
} catch (IOException e) {
}