package com.chenyang.nse.bussiness.tools.audit;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

public class FileUtil {
   public static void main(String[] args) throws Exception {
      List<String> fileNames = new ArrayList();
      findFileList(new File("F:\\HTML\\bootstrap"), fileNames);
      System.out.println();

      for(String value : fileNames) {
         System.out.println("file:" + value);
      }

   }

   public static void findFileList(File dir, List<String> fileNames) {
      if (dir.exists() && dir.isDirectory()) {
         String[] files = dir.list();

         for(int i = 0; i < files.length; ++i) {
            File file = new File(dir, files[i]);
            if (file.isFile()) {
               fileNames.add(dir + "/" + file.getName());
            } else {
               findFileList(file, fileNames);
            }
         }

      }
   }
}
