You can upload projects using the jdtand libraries eclipse core.
Using the following code, you can download all projects in the workspace.
IWorkspace workspace = ResourcesPlugin.getWorkspace();
IWorkspaceRoot root = workspace.getRoot();
IProject[] projects = root.getProjects();
Then you can get packages and, in turn, java files.
IPackageFragment[] packages = JavaCore.create(project).getPackageFragments();
IPackageFragment mypackage = packages.get(0);
ICompilationUnit unit = mypackage.getCompilationUnits();
Then you can use this ICompilationUnit object to get CompilationUnit
ASTParser parser = ASTParser.newParser(AST.JLS3);
parser.setKind(ASTParser.K_COMPILATION_UNIT);
parser.setSource(unit);
parser.setResolveBindings(true);
CompilationUnit cUnit = parser.createAST(null);
CompilationUnit ASTParser.