code: public File[] listFiles(FileFilter filter) {
          File[] files = listFiles();
          if (filter == null || files == null) {
              return files;
          }
          List<File> result = new ArrayList<File>(files.length);
          for (File file : files) {
              if (filter.accept(file)) {
                  result.add(file);
              }
          }
          return result.toArray(new File[result.size()]);
      }
docs: Gets a list of the files in the directory represented by this file. This
  list is then filtered through a FileFilter and matching files are
  returned as an array of files. Returns {@code null} if this file is not a
  directory. If {@code filter} is {@code null} then all files match.
  <p>
  The entries {@code .} and {@code ..} representing the current and parent
  directories are not returned as part of the list.
  
  @param filter
  the filter to match names against, may be {@code null}.
  @return an array of files or {@code null}.