public void accept(final Path file) throws InterruptedException {
  logger.info(String.format("Sending to thread pool; will queue if full: \"%s\".",file));
  permits.acquire();
  executor.execute(new ConsumerTask(file));
}

public void accept ( final Path file ) throws InterruptedException { logger . info ( String . format ( "Sending to thread pool; will queue if full: \"%s\"." , file ) ) ; permits . acquire ( ) ; executor . execute ( new ConsumerTask ( file ) ) ; }
consume a file . jobs are put in an bounded queue and executed in serial , in a separate thread . this method blocks when the queue bound is reached to avoid flooding the consumer .
