1 package eu.svjatoslav.inspector.java.methods;
5 import eu.svjatoslav.commons.file.FilePathParser;
9 private final File projectPath;
11 public Project(final File projectPath) {
12 this.projectPath = projectPath;
18 if (!projectPath.exists())
19 System.out.println("Project not found on path: " + projectPath);
21 if (!projectPath.canRead())
22 System.out.println("Cannot read project path: " + projectPath);
24 if (projectPath.isDirectory())
25 parseDirectory(projectPath);
27 if (projectPath.isFile())
28 parseFile(projectPath);
31 public void parseDirectory(final File file) {
33 for (final File subFile : file.listFiles()) {
38 if (subFile.isDirectory())
39 parseDirectory(subFile);
43 public void parseFile(final File file) {
44 final String fileExtension = FilePathParser.getFileExtension(file);
45 if ("java".equalsIgnoreCase(fileExtension)){
46 JavaFile javaFile = new JavaFile(file);