Search in sources :

Example 1 with GHBranch

use of org.kohsuke.github.GHBranch in project faber by mkuschov.

the class GitLoader method GetWatchedReposTrees.

public HashMap<GHRepository, HashMap<GHBranch, GHTree>> GetWatchedReposTrees() {
    HashMap<GHRepository, HashMap<GHBranch, GHTree>> watchedReposTrees = new HashMap<>();
    this.watchedRepos.forEach(i -> {
        HashMap<GHBranch, GHTree> tmp = new HashMap<>();
        try {
            i.getBranches().forEach((name, branch) -> {
                try {
                    GHTree urlToBracnhTree = i.getTreeRecursive(branch.getSHA1(), 1);
                    tmp.put(branch, urlToBracnhTree);
                    System.out.println(i.getName() + "    " + branch.getName() + "    " + urlToBracnhTree.toString());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            });
            watchedReposTrees.put(i, tmp);
        } catch (IOException e) {
            e.printStackTrace();
        }
    });
    return watchedReposTrees;
}
Also used : GHRepository(org.kohsuke.github.GHRepository) HashMap(java.util.HashMap) GHTree(org.kohsuke.github.GHTree) GHBranch(org.kohsuke.github.GHBranch) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)1 HashMap (java.util.HashMap)1 GHBranch (org.kohsuke.github.GHBranch)1 GHRepository (org.kohsuke.github.GHRepository)1 GHTree (org.kohsuke.github.GHTree)1