Class FileMonitor


  • public class FileMonitor
    extends java.lang.Object
    polls a file and terminates as soon as it exists.
    • Constructor Detail

      • FileMonitor

        public FileMonitor​(java.io.File file)
      • FileMonitor

        public FileMonitor​(java.io.File file,
                           java.lang.Process process)
    • Method Detail

      • waitForFile

        public boolean waitForFile​(java.lang.Long timeout)
                            throws JMadException
        waits until a file exists.
        Parameters:
        timeout - the maximum millisecs to wait (if null, then we wait forever ...)
        Returns:
        true, if the file finally exists, false, if the monitored process was interrupted or we timed out.
        Throws:
        FileMonitor.WaitingFailedException - if something goes wrong during the waiting
        JMadException