package J20250804.demo01;

import java.io.IOException;
import java.util.concurrent.ExecutionException;

/**
 * @author WanJl
 * @version 1.0
 * @title Main
 * @description
 * @create 2025/8/4
 */
public class Main {
    public static void main(String[] args) {
        String directoryPath="D:\\Code\\javaProjects\\javaSE\\src\\J20250802";
        String outputFilePath="result.txt";

        FileStatManager fileStatManager=new FileStatManager(directoryPath);
        try {
            System.out.println("开始统计"+directoryPath+"文件下的所有.java文件");
            fileStatManager.startStatistics();
            System.out.println(fileStatManager.getResults());
            fileStatManager.writeResultsToFile(outputFilePath);
            System.out.println("保存完成......");
        } catch (IOException e) {
            e.printStackTrace();
        } catch (ExecutionException e) {
            e.printStackTrace();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

    }
}
