Follows changes in the file, calling the TailerListener's handle method
for each new line.
358319
@Override
    public void run() {
        final ScheduledFuture<?> future = this.executor.scheduleWithFixedDelay(this.scheduled, 0, this.delayMillis,
                TimeUnit.MILLISECONDS);
        try {
            this.runTrigger.await();
        } catch (final InterruptedException e) {
            this.listener.handle(e);
        } finally {
            future.cancel(true); // stop the periodic reading
            this.scheduled.cleanup();
            this.executor.shutdownNow();
            this.listener.destroy();
        }
    }
1061494
function LineReader(file) {
  if (typeof file === 'string') {
    this.readstream = fs.createReadStream(file);
  } else {
    this.readstream = file;
  }
  this.remainBuffers = [];
  var self = this;
  this.readstream.on('data', function (data) {
    self.ondata(data);
  });
  this.readstream.on('error', function (err) {
    self.emit('error', err);
  });
  this.readstream.on('end', function () {
    self.emit('end');
  });
}
346873
public void moveThisFile(File file, String strName, String strParentSource)
    {
        if (m_iPass == 1)
        {
            if (!strName.startsWith("ObjectFactory"))
                if (strName.endsWith(".java"))
            {
                if (m_mapClasses.containsKey(strName))
                {
                    if (!SHARED.equals(m_mapClasses.get(strName)))
                    {   // First time, add current entry
                        this.addClassToShared(strName, m_mapClasses.get(strName));
                    }
                    m_mapClasses.put(strName, SHARED);
                    this.addClassToShared(strName, strParentSource);
                }
                else
                {
                    m_mapClasses.put(strName, strParentSource);
                }
            }
        }
        else
        {
            m_bCurrentShared = SHARED.equals(m_mapClasses.get(strName));
            if (m_bCurrentShared)
            {
                strParentSource = ConvertCodePackage.getSharedPackage(strParentSource);
            }
            super.moveThisFile(file, strName, strParentSource);
        }
    }
618226
function queue(context, file, fileSet, next) {
  var origin = file.history[0]
  var map = fileSet.complete
  var complete = true

  if (!map) {
    map = {}
    fileSet.complete = map
  }

  debug('Queueing `%s`', origin)

  map[origin] = next

  fileSet.valueOf().forEach(each)

  if (!complete) {
    debug('Not flushing: some files cannot be flushed')
    return
  }

  fileSet.complete = {}

  fileSet.pipeline.run(fileSet, done)

  function each(file) {
    var key = file.history[0]

    if (stats(file).fatal) {
      return
    }

    if (typeof map[key] === 'function') {
      debug('`%s` can be flushed', key)
    } else {
      debug('Interupting flush: `%s` is not finished', key)
      complete = false
    }
  }

  function done(error) {
    debug('Flushing: all files can be flushed')

    /* Flush. */
    for (origin in map) {
      map[origin](error)
    }
  }
}
175489
def flush_if_ended(self):
		""""""
		if self.ended and self.next and len(self.files) == self.transformed:
			future = asyncio.ensure_future(self.transformer.flush())
			future.add_done_callback(lambda x: self.next.end_of_stream())
1156502
def execute_lines(self, lines):
        """"""
        self.shell.execute_lines(to_text_string(lines))
        self.shell.setFocus()
1216851
public static GenerationFileHandler makeNew(String filename, boolean append, boolean shouldManifest) throws SecurityException, IOException {
        FileUtils.moveAsideIfExists(new File(filename));
        return new GenerationFileHandler(filename, append, shouldManifest);
    }
1261555
public void onFileChange(File file) {
        mojo.getLog().info(EMPTY_STRING);
        mojo.getLog().info("The watcher has detected a change in " + file.getAbsolutePath());
        mojo.getLog().info(EMPTY_STRING);
        for (Watcher watcher : watchers) {
            if (watcher.accept(file)) {
                cleanupErrorFile(watcher);
                // This flag will be set to false if the processing must be interrupted.
                boolean continueProcessing;
                try {
                    continueProcessing = watcher.fileUpdated(file);
                } catch (WatchingException e) { //NOSONAR
                    mojo.getLog().debug(watcher + " has thrown an exception while handling the " + file.getName() + EMPTY_STRING +
                            " update", e);
                    mojo.getLog().error(String.format(WATCHING_EXCEPTION_MESSAGE, e.getMessage()));
                    createErrorFile(watcher, e);
                    continueProcessing = false;
                }
                if (!continueProcessing) {
                    break;
                }
            }
        }
        mojo.getLog().info(EMPTY_STRING);
        mojo.getLog().info(EMPTY_STRING);
    }
693964
public void appendLine(final Line line)
    {
        if (this.lineTail == null)
        {
            this.lines = this.lineTail = line;
        }
        else
        {
            this.lineTail.nextEmpty = line.isEmpty;
            line.prevEmpty = this.lineTail.isEmpty;
            line.previous = this.lineTail;
            this.lineTail.next = line;
            this.lineTail = line;
        }
    }
969724
function processServeQueue() {
      while (serveQueue.length) {
        const item = serveQueue.shift();
        _serveFile(item.file, item.done);
        // It is possible start compiling while in release.
        if (state.compilationCompleted !== _currentState) {
          break;
        }
      }
    }
950258
public function methodChanged(): void
    {
        assert($this->offsetExists(self::VAR_LINE_METHOD));

        if (self::METHOD_POST === $this->offsetGet(self::VAR_LINE_METHOD)) {
            $this->offsetSet(self::VAR_BODY, null);
            if ($this->offsetExists(self::VAR_PARSED_POST)
                && is_null($this->offsetGet(self::VAR_PARSED_POST))) {
                $this->offsetSet(self::VAR_PARSED_POST, new MutableArray());
            }
            if ($this->offsetExists(self::VAR_PARSED_FILES)
                && is_null($this->offsetGet(self::VAR_PARSED_FILES))) {
                $this->offsetSet(self::VAR_PARSED_FILES, new MutableArray());
            }
        } else if (self::METHOD_PUT === $this->offsetGet(self::VAR_LINE_METHOD)) {
            if ($this->offsetExists(self::VAR_BODY)
                && is_null($this->offsetGet(self::VAR_BODY))) {
                $this->offsetSet(self::VAR_BODY, '');
            }
            $this->offsetSet(self::VAR_PARSED_POST, null);
            $this->offsetSet(self::VAR_PARSED_FILES, null);
        } else {
            $this->offsetSet(self::VAR_BODY, null);
            $this->offsetSet(self::VAR_PARSED_POST, null);
            $this->offsetSet(self::VAR_PARSED_FILES, null);
        }
    }
187698
function run (files, callback) {
  let self = this,
    i = 0;

  function next(err, files) {
    let mw = self.middleware[i++];

    if (mw) {
      mw(files, self, next);
    }
    else {
      callback(null, files);
    }

  };

  next(null, files);
}
927083
def update_file(file)
      log "file: #{file}"
      text = File.read(file)
      text = yield text
      File.open(file, 'w') { |f| f.write(text) }
    end
1335928
void handleAdd() {
        BoofSwingUtil.checkGuiThread();
        java.util.List<File> paths = browser.getSelectedFiles();

        for (int i = 0; i < paths.size(); i++) {
            File f = paths.get(i);

            // if it's a directory add all the files in the directory
            if( f.isDirectory() ) {
                java.util.List<String> files = UtilIO.listAll(f.getPath());
                Collections.sort(files);
                for (int j = 0; j < files.size(); j++) {
                    File p = new File(files.get(j));
                    // Note: Can't use mimetype to determine if it's an image or not since it isn't 100% reliable
                    if( p.isFile() ) {
                        selected.addPath(p);
                    }
                }
            } else {
                selected.addPath(f);
            }
        }
    }
912897
public void addListener (FileChangedListener fileListener)
  {
    // Don't add if its already there
    for (Iterator<WeakReference<FileChangedListener>> i = listeners_.iterator(); i.hasNext(); ) {
      WeakReference<FileChangedListener> reference = i.next();
      FileChangedListener listener = reference.get();
      if (listener == fileListener)
        return;
    }

    // Use WeakReference to avoid memory leak if this becomes the
    // sole reference to the object.
    listeners_.add(new WeakReference<FileChangedListener>(fileListener));
  }
716023
private void handleFile(final String filePath, final AsyncFile file, final InputGroup group) {
    final AtomicLong position = new AtomicLong();
    final AtomicBoolean complete = new AtomicBoolean();
    final AtomicInteger handlerCount = new AtomicInteger();
    group.messageHandler(new Handler<Buffer>() {
      @Override
      public synchronized void handle(Buffer buffer) {
        file.write(buffer, position.get(), new Handler<AsyncResult<Void>>() {
          @Override
          public void handle(AsyncResult<Void> result) {
            if (result.failed()) {
              file.close();
              group.messageHandler(null);
              group.endHandler(null);
              try {
                input.vertx().fileSystem().deleteSync(filePath);
              } catch (Exception e) {
              }
              if (exceptionHandler != null) {
                exceptionHandler.handle(result.cause());
              }
            }

            // Decrement the handler count.
            handlerCount.decrementAndGet();

            // We need to handle for cases where the end handler was called
            // before all the data was written to the file.
            if (complete.get() && handlerCount.get() == 0) {
              closeFile(filePath, file);
            }
          }
        });
        // Increment the handler count and current buffer position.
        handlerCount.incrementAndGet();
        position.addAndGet(buffer.length());
      }
    });
    group.endHandler(new Handler<Void>() {
      @Override
      public void handle(Void event) {
        // If there are still handlers processing the data then wait for
        // those handlers to complete by simply setting the complete flag.
        complete.set(true);
        if (handlerCount.get() == 0) {
          closeFile(filePath, file);
        }
      }
    });
  }
188849
def on_change(modified, added, deleted)
      # Modifications and additions are treated the same.
      (modified + added).uniq.each do |path|
        if file = Ichiban::ProjectFile.from_abs(path)
          begin
            @loader.change(file) # Tell the Loader that this file has changed
            file.update
          rescue Exception => exc
            Ichiban.logger.exception(exc)
          end
        end
      end
      
      # Deletions are handled specially.
      deleted.each do |path|
        Ichiban::Deleter.new.delete_dest(path)
      end
      
      # Finally, propagate this change to any dependent files.
      (modified + added + deleted).uniq.each do |path|
        begin
          Ichiban::Dependencies.propagate(path)
        rescue => exc
          Ichiban.logger.exception(exc)
        end
      end
    end