1 package eu.svjatoslav.inspector.java.methods;
4 import java.io.IOException;
6 import eu.svjatoslav.commons.file.FilePathParser;
10 private final File projectPath;
12 public Project(final File projectPath) {
13 this.projectPath = projectPath;
19 if (!projectPath.exists())
20 System.out.println("Project not found on path: " + projectPath);
22 if (!projectPath.canRead())
23 System.out.println("Cannot read project path: " + projectPath);
25 if (projectPath.isDirectory())
26 parseDirectory(projectPath);
28 if (projectPath.isFile())
29 parseFile(projectPath);
32 public void parseDirectory(final File file) {
34 for (final File subFile : file.listFiles()) {
39 if (subFile.isDirectory())
40 parseDirectory(subFile);
44 public void parseFile(final File file) {
45 final String fileExtension = FilePathParser.getFileExtension(file);
46 if ("java".equalsIgnoreCase(fileExtension))
48 final JavaFile javaFile = new JavaFile(file);
49 } catch (final IOException e) {
50 System.out.println("Error parsing file: " + file.toString()
51 + ", " + e.toString());