@@ -0,0 +1,2023 @@
+import java.io.BufferedReader;%0Aimport java.io.File;%0Aimport java.io.FileReader;%0Aimport java.io.IOException;%0Aimport java.util.LinkedList;%0Aimport java.util.List;%0A%0A/**%0A * Created by Flyme on 2016/5/5.%0A */%0Apublic class ProjectCodeLineCount %7B%0A%0A    public static int totalCodeLine(String path) throws IOException %7B%0A        return countFile(getAllFileInDir(getJavaCodeLineCount(path)));%0A    %7D%0A%0A    private static File getJavaCodeLineCount(String path) throws IOException %7B%0A        File file = new File(path);%0A        if (file.exists()) %7B%0A            List%3CFile%3E files = getAllFileInDir(file);%0A            return file;%0A        %7D else %7B%0A            throw new IOException(%22Wrong path%22);%0A        %7D%0A    %7D%0A%0A    private static List%3CFile%3E getAllFileInDir(File target) %7B%0A        LinkedList%3CFile%3E fileList = new LinkedList%3C%3E();%0A        LinkedList%3CFile%3E dirs = new LinkedList%3C%3E();%0A        dirs.push(target);%0A        while (!dirs.isEmpty()) %7B%0A            target = dirs.pop();%0A            File%5B%5D files = target.listFiles();%0A            for (File file : files) %7B%0A                if (!file.isDirectory()) %7B%0A                    if (file.getName().endsWith(%22.java%22))%0A                        fileList.push(file);%0A                %7D else %7B%0A                    dirs.push(file);%0A                %7D%0A            %7D%0A        %7D%0A        return fileList;%0A    %7D%0A%0A    private static int countFile(List%3CFile%3E files) %7B%0A        int totalCount = 0;%0A        for (File file : files) %7B%0A            try %7B%0A                FileReader reader = new FileReader(file);%0A                BufferedReader br = new BufferedReader(reader);%0A                System.out.println(%22Loading file:%5B%22 + file.getName() + %22%5D%22);%0A                String s;%0A                while ((s = br.readLine()) != null) %7B%0A                    //empty line won't be counted%0A                    if (s.trim().length() != 0)%0A                        totalCount++;%0A                %7D%0A            %7D catch (IOException e) %7B%0A                e.printStackTrace();%0A            %7D%0A        %7D%0A        return totalCount;%0A    %7D%0A%7D%0A%0A

Create ProjectCodeLineCount.java