Can I use Timer in a recursive method that must be executed repeatedly ?
Is this below gonna work?
Recursive method:
public class AppTarefa extends TimerTask {
public void run() {
if (updater.listenFile()){
this.process();
this.run();
}
else{
this.run();
}
}
}
public class App {
Timer timer;
public App(long delay, long interval){
timer = new Timer();
timer.scheduleAtFixedRate(new AppTarefa(), delay, interval);
}
}