Seria algo como esto:
Código java:
Ver original @Override
public void run() {
String content
= getContent
(FILE
); while (true) {
String actualContent
= getContent
(FILE
); if (!content.equals(actualContent)) {
System.
out.
printf("Nuevo contenido: %s\n", actualContent
); break;
}
try {
//tu logger o manejo de excepciones
}
}
}
}, this.getClass().getSimpleName() + " - Thread");
thread.start();
Función getContent:
Código java:
Ver original try {
while (null != (line = bufferedReader.readLine())) {
content += line;
}
//tu logger o manejo de excepciones
//tu logger o manejo de excepciones
} finally {
if (null != bufferedReader) {
try {
bufferedReader.close();
//tu logger o manejo de excepciones
}
}
}
return content;
}