code: private static void init(List<File> list, File dir, Filter filter)
      {
          File[] files = dir.listFiles();
          for (int i = 0; i < files.length; i++)
          {
              if (files[i].isDirectory())
              {
                  init(list, files[i], filter);
              }
              else
              {
                  if (filter == null || filter.accepts(files[i].getAbsolutePath()))
                  {
                      list.add(files[i]);
                  }
              }
          }
      }
docs: Creates the.
  
  @param list
  the list
  @param dir
  the dir
  @param filter
  the filter
  
  @throws Exception
  the exception