@Override
    public boolean hasNext() {
      if (files == null) {
        return false;
      }
      return i<files.length;
    }
Filter for valid files only (no dir, no hidden)
hcatalog/server-extensions/src/main/java/org/apache/hive/hcatalog/listener/DbNotificationListener.java