public static boolean waitForFile(File file) {
        if (file.isFile()) {
            return true;
        } else {
            // Start waiting 10 seconds maximum
            long timeout = System.currentTimeMillis() + FILE_WAIT_TIMEOUT;
            while (System.currentTimeMillis() <= timeout) {
                sleepQuietly(10);
                if (file.isFile()) {
                    return true;
                }
            }
        }
        // Timeout reached
        return false;
    }
public static boolean waitForFile ( File file ) { if ( file . isFile ( ) ) { return true ; } else { long timeout = System . currentTimeMillis ( ) + FILE_WAIT_TIMEOUT ; while ( System . currentTimeMillis ( ) <= timeout ) { sleepQuietly ( 10 ) ; if ( file . isFile ( ) ) { return true ; } } } return false ; }
Waits for a file to be created.

@param file the file
@return {@literal true} if the file was created, {@literal false} otherwise