private boolean processOne(File file, boolean topLevel) {
    try {
      if (file.isDirectory()) {
        return processDirectory(file, topLevel);
      }

      String path = file.getPath();

      if (path.endsWith(".zip") || path.endsWith(".jar") || path.endsWith(".apk")) {
        return processArchive(file);
      }
      if (filter.accept(path)) {
        byte[] bytes = FileUtils.readFile(file);
        return consumer.processFileBytes(path, file.lastModified(), bytes);
      } else {
        return false;
      }
    } catch (Exception ex) {
      consumer.onException(ex);
      return false;
    }
  }
Processes one file.

@param file {@code non-null;} the file to process
@param topLevel whether this is a top-level file (that is, specified directly on the
    commandline)
@return whether any processing actually happened
android/android_framework/dex-maker/src/main/java/com/android/dx/cf/direct/ClassPathOpener.java