Package edu.handong.csee.isel
Class GitFunctions
java.lang.Object
edu.handong.csee.isel.GitFunctions
public class GitFunctions
extends java.lang.Object
This is a class that contains several methods necessary to collect commits in Github.
-
Constructor Summary
Constructors Constructor Description GitFunctions(java.lang.String projectName, java.lang.String outPath, java.lang.String gitURL, boolean isAGSZZ) -
Method Summary
Modifier and Type Method Description java.util.List<org.eclipse.jgit.revwalk.RevCommit>getAllCommitList()After checking whether to clone the repository, if it is not cloned, clone the repository.java.io.FilegetGitDirectory()This method returns the location where the file to be cloned will be saved.java.lang.StringgetReferencePath()This method returns the path of the reference folder.java.io.FileGitClone()This method is used to clone the repository from Github.
-
Constructor Details
-
GitFunctions
public GitFunctions(java.lang.String projectName, java.lang.String outPath, java.lang.String gitURL, boolean isAGSZZ)
-
-
Method Details
-
getAllCommitList
public java.util.List<org.eclipse.jgit.revwalk.RevCommit> getAllCommitList() throws org.eclipse.jgit.api.errors.InvalidRemoteException, org.eclipse.jgit.api.errors.TransportException, org.eclipse.jgit.api.errors.GitAPIException, java.io.IOExceptionAfter checking whether to clone the repository, if it is not cloned, clone the repository. Then collect all commtis in that repository.- Returns:
- commitList
- Throws:
org.eclipse.jgit.api.errors.InvalidRemoteExceptionorg.eclipse.jgit.api.errors.TransportExceptionorg.eclipse.jgit.api.errors.GitAPIExceptionjava.io.IOException
-
getReferencePath
public java.lang.String getReferencePath()This method returns the path of the reference folder.- Returns:
-
getGitDirectory
public java.io.File getGitDirectory()This method returns the location where the file to be cloned will be saved.- Returns:
- clonedDirectory
-
GitClone
public java.io.File GitClone() throws org.eclipse.jgit.api.errors.InvalidRemoteException, org.eclipse.jgit.api.errors.TransportException, org.eclipse.jgit.api.errors.GitAPIExceptionThis method is used to clone the repository from Github.- Returns:
- Throws:
org.eclipse.jgit.api.errors.InvalidRemoteExceptionorg.eclipse.jgit.api.errors.TransportExceptionorg.eclipse.jgit.api.errors.GitAPIException
-