Removed half-baked java source code parser.
[javainspect.git] / src / main / java / eu / svjatoslav / inspector / java / methods / ProjectScanner.java
diff --git a/src/main/java/eu/svjatoslav/inspector/java/methods/ProjectScanner.java b/src/main/java/eu/svjatoslav/inspector/java/methods/ProjectScanner.java
deleted file mode 100755 (executable)
index c68865d..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * JavaInspect - Utility to visualize java software
- * Copyright (C) 2013-2020, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- */
-
-package eu.svjatoslav.inspector.java.methods;
-
-import eu.svjatoslav.commons.file.FilePathParser;
-import eu.svjatoslav.commons.string.tokenizer.InvalidSyntaxException;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-public class ProjectScanner {
-
-    public final List<JavaFile> javaFiles = new ArrayList<>();
-    private final File scanPath;
-    Map<File, Project> projects = new HashMap<>();
-
-    public ProjectScanner(final File projectPath) {
-        scanPath = projectPath;
-        parse();
-    }
-
-    public List<Clazz> getAllClasses() {
-        final List<Clazz> result = new ArrayList<>();
-
-        for (final JavaFile file : javaFiles)
-            result.addAll(file.classes);
-
-        return result;
-    }
-
-    public void parse() {
-
-        if (!scanPath.exists())
-            System.out.println("Path not found: " + scanPath);
-
-        if (!scanPath.canRead())
-            System.out.println("Cannot read path: " + scanPath);
-
-        if (scanPath.isDirectory())
-            parseDirectory(scanPath);
-
-        if (scanPath.isFile())
-            parseFile(scanPath);
-    }
-
-    public void parseDirectory(final File file) {
-
-        File[] filesList = file.listFiles();
-        if (filesList == null) throw new RuntimeException("Cannot scan directory: " + file);
-
-        for (final File subFile : filesList) {
-
-            if (subFile.isFile())
-                parseFile(subFile);
-
-            if (subFile.isDirectory())
-                parseDirectory(subFile);
-        }
-    }
-
-    public void parseFile(final File file) {
-        final String fileExtension = FilePathParser.getFileExtension(file);
-        if ("java".equalsIgnoreCase(fileExtension))
-            try {
-                final JavaFile javaFile = new JavaFile(file);
-                javaFiles.add(javaFile);
-            } catch (final IOException e) {
-                System.out.println("Error parsing file: " + file.toString()
-                        + ": " + e.toString());
-            } catch (final InvalidSyntaxException e) {
-                System.out.println("Syntax error occured while parsing file: "
-                        + file.toString() + ": " + e.toString());
-            }
-    }
-
-}