The method waits for a file to appear for a given amount of time. To do so it calls Thread.sleep several times. If the thread is interrupted, the interrupt will be ignored by catching the ThreadInterrupted exception and waiting further.
Catching the ThreadInterrupted exception automatically clears the thread's interrupted flag. Consequently the calling method has no chance to detect whether the thread was interrupted. A possible solution is to restore the interrupted status before returning - something like this: