Class GitTool


  • public class GitTool
    extends java.lang.Object
    Git toolbox
    This class is a singleton use it as GitTool.getInstance()
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String HEAD
      Head revision
      static java.lang.String MASTER
      Master branch name
      static java.lang.String ORIGIN
      Origin
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void addRemote​(java.io.File dir, java.lang.String name, java.lang.String uri)
      Add remote
      void checkout​(ObjectDB mdl, java.lang.String commitId)
      Checkout commit ID in the module's repository worktree.
      void checkout​(ObjectDB mdl, java.lang.String branch, boolean create, java.lang.String remoteBranch)
      Checkout a branch in the module's repository worktree.
      void checkout​(java.io.File dir, java.lang.String commitId)
      Checkout a commit ID in the repository worktree.
      void checkout​(java.io.File dir, java.lang.String branch, boolean create, java.lang.String remoteBranch)
      Checkout a branch in the repository worktree.
      void clean​(ObjectDB mdl)
      Delete all files in the module's repository (excepted .git directory).
      void clean​(java.io.File dir)
      Delete all files in the repository (excepted .git directory).
      void clone​(java.io.File dir, java.lang.String uri, java.lang.String username, java.lang.String password, java.lang.String remote, java.lang.String branch)
      Clone an existing repository
      java.lang.String commitModule​(ObjectDB mdl, java.lang.String msg)
      Deprecated.
      Use commitModule with addtional format parameter
      java.lang.String commitModule​(ObjectDB mdl, java.lang.String format, boolean exploded, java.lang.String msg)
      Commit selected module
      int countCommits​(ObjectDB mdl)
      Count commits in a module's repository
      int countCommits​(ObjectDB mdl, java.lang.String name, java.lang.String message, java.lang.String user, java.lang.String email, java.lang.String dateMin, java.lang.String dateMax)
      Count commits in a module's repository
      int countCommits​(org.eclipse.jgit.lib.Repository rep)
      Count commits in a repository
      int countCommits​(org.eclipse.jgit.lib.Repository rep, java.lang.String name, java.lang.String message, java.lang.String user, java.lang.String email, java.lang.String dateMin, java.lang.String dateMax)
      Count commits in a repository
      org.eclipse.jgit.api.Git create​(java.io.File dir)
      Create a new repository
      java.lang.String delete​(ObjectDB mdl)
      Move the module's directory to the recylebin if it exists (or simply delete it if move is not successful)
      java.lang.String dumpCommit​(org.eclipse.jgit.lib.Repository rep, org.eclipse.jgit.lib.ObjectId commitId)
      Dump commit information
      java.lang.String dumpModuleCommit​(ObjectDB mdl, org.eclipse.jgit.lib.ObjectId commitId)
      Dump module's commit for specified row ID
      void fetch​(java.io.File dir, java.lang.String username, java.lang.String password, java.lang.String remote)
      Fetch from remote
      org.json.JSONArray getAllCommits​(org.eclipse.jgit.lib.Repository rep, int n)
      Get last commits information
      org.json.JSONArray getAllCommits​(org.eclipse.jgit.lib.Repository rep, int start, int max)
      Get last commits information
      org.json.JSONArray getAllCommits​(org.eclipse.jgit.lib.Repository rep, int start, int max, java.lang.String name, java.lang.String message, java.lang.String user, java.lang.String email, java.lang.String dateMin, java.lang.String dateMax)
      Get last commits information
      org.json.JSONArray getAllModuleCommits​(ObjectDB mdl, int n)
      Get modules's last commits information for module
      org.json.JSONArray getAllModuleCommits​(ObjectDB mdl, int start, int max)
      Get modules's last commits information for module
      org.json.JSONArray getAllModuleCommits​(ObjectDB mdl, int start, int max, java.lang.String name, java.lang.String message, java.lang.String user, java.lang.String email, java.lang.String dateMin, java.lang.String dateMax)
      Get modules's last commits information for module
      java.util.List<java.lang.String> getBranchNames​(ObjectDB mdl, boolean local, boolean remote)
      Get branch names from an existing repository
      java.util.List<java.lang.String> getBranchNames​(java.io.File dir, boolean local, boolean remote)
      Get branch names from an existing repository
      java.util.List<java.lang.String> getBranchNames​(org.eclipse.jgit.api.Git git, boolean local, boolean remote)
      Get branch names from an existing repository
      java.lang.String getCurrentBranchName​(ObjectDB mdl)
      Get current branch name from an existing repository
      java.lang.String getCurrentBranchName​(java.io.File dir)
      Get current branch name from an existing repository
      org.json.JSONArray getDiff​(org.eclipse.jgit.lib.Repository rep, org.eclipse.jgit.lib.ObjectId oldCommitId, org.eclipse.jgit.lib.ObjectId newCommitId)
      Get diff entries of 2 revisions
      org.json.JSONArray getDiff​(org.eclipse.jgit.lib.Repository rep, org.eclipse.jgit.revwalk.RevCommit oldCommit, org.eclipse.jgit.revwalk.RevCommit newCommit)
      Get diff entries of 2 revisions
      java.lang.String getFormat​(java.lang.String module, java.lang.String defaultFormat)
      Get the commit format (json or xml) from module-info.json
      static GitTool getInstance()
      Get Git tool singleton
      org.json.JSONArray getLastCommitDiff​(org.eclipse.jgit.lib.Repository rep)
      Get last commit's diff entries
      java.util.List<java.lang.String> getLocalBranchNames​(ObjectDB mdl)
      Get local branch names from an existing repository
      java.util.List<java.lang.String> getLocalBranchNames​(java.io.File dir)
      Get local branch names from an existing repository
      java.util.List<java.lang.String> getLocalBranchNames​(org.eclipse.jgit.api.Git git)
      Get local branch names from an existing repository
      java.io.File getModuleFile​(Grant g, java.lang.String name, java.io.File dir)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use FlowXML.getModuleZIPFileFromDir
      org.json.JSONObject getModuleJSON​(ObjectDB mdl)
      Get JSON tree from a module
      java.io.InputStream getModuleZIP​(Grant g, java.lang.String name)
      Get clean ZIP stream from a module name
      java.io.InputStream getModuleZIP​(Grant g, java.lang.String name, java.io.File dir)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use FlowXML.getModuleZIPStreamFromDir
      java.io.InputStream getModuleZIP​(ObjectDB mdl)
      Get clean ZIP stream from a module
      java.lang.String getPrevCommitId​(ObjectDB mdl, java.lang.String commitId)
      Get previous module's commit ID for specified commit ID
      java.lang.String getPrevCommitId​(org.eclipse.jgit.lib.Repository rep, java.lang.String commitId)
      Get previous commit ID for specified commit ID
      java.lang.String getRawDiff​(ObjectDB mdl, java.lang.String commitId)
      Get raw diff for specified commit ID
      java.lang.String getRawDiff​(org.eclipse.jgit.lib.Repository rep, java.lang.String commitId)
      Get raw diff for specified commit ID
      java.lang.String getRawDiff​(org.eclipse.jgit.lib.Repository rep, org.eclipse.jgit.revwalk.RevCommit oldCommit, org.eclipse.jgit.revwalk.RevCommit newCommit)
      Get raw diff of 2 revisions
      java.util.List<java.lang.String> getRemoteBranchNames​(ObjectDB mdl)
      Get remote branch names from an existing repository
      java.util.List<java.lang.String> getRemoteBranchNames​(java.io.File dir)
      Get remote branch names from an existing repository
      java.util.List<java.lang.String> getRemoteBranchNames​(org.eclipse.jgit.api.Git git)
      Get remote branch names from an existing repository
      java.util.List<java.lang.String> getRemoteNames​(ObjectDB mdl)
      Get remote names from an existing repository
      java.util.List<java.lang.String> getRemoteNames​(java.io.File dir)
      Get remote names from an existing repository
      java.util.List<java.lang.String> getRemoteNames​(org.eclipse.jgit.api.Git git)
      Get remote names from an existing repository
      java.lang.String getRemoteURI​(java.io.File dir, java.lang.String name)
      Get remote URI
      java.io.File getRepositoryDir​(ObjectDB mdl)
      Get repository directory file for specified name
      java.io.File getRepositoryDir​(java.lang.String name)
      Get repository directory file for specified name
      java.util.List<java.lang.String> getTags​(ObjectDB mdl, java.lang.String commitId)
      Get all tags for a commit ID
      java.util.List<java.lang.String> getTags​(java.io.File dir, java.lang.String commitId)
      Get all tags for a commit ID
      Message importModule​(Grant g, java.io.File dir, org.json.JSONArray diffs)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use commitModule with addtional format parameter
      Message importModule​(Grant g, java.io.File dir, org.json.JSONArray diffs, boolean async)
      Import module from repository checkout
      Message importModule​(ObjectDB mdl)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use commitModule with addtional format parameter
      Message importModule​(ObjectDB mdl, boolean async)
      Import module from repository checkout
      boolean isExploded​(java.lang.String module)
      Is the commit format (json or xml) exploded?
      this is checking the presence of the configuration folder
      java.lang.String lsremote​(java.lang.String uri, java.lang.String username, java.lang.String password)
      Get list of remote repository refs
      boolean merge​(java.io.File dir, java.lang.String remote)
      Merge
      boolean pull​(java.io.File dir, java.lang.String username, java.lang.String password, java.lang.String remote)
      Pull from remote
      void push​(java.io.File dir, java.lang.String username, java.lang.String password, java.lang.String remote)
      Push to remote
      void removeRemote​(java.io.File dir, java.lang.String name)
      Remove remote
      boolean repositoryExists​(ObjectDB mdl)
      Check whether a repository exists for specified name
      boolean repositoryExists​(java.lang.String name)
      Check whether a repository exists for specified name
      void reset​(ObjectDB mdl, boolean hard)
      Reset the module's repository worktree.
      void reset​(java.io.File dir, boolean hard)
      Reset the repository worktree.
      java.lang.String revert​(java.io.File dir)
      Revert last commit
      void tag​(ObjectDB mdl, java.lang.String tag, java.lang.String commitId)
      Tag module's commit
      void tag​(java.io.File dir, java.lang.String tag, java.lang.String commitId)
      Tag commit
      void updateRemote​(java.io.File dir, java.lang.String name, java.lang.String uri)
      Update remote
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getInstance

        public static final GitTool getInstance()
        Get Git tool singleton
        Returns:
        Git tool singleton
      • getRepositoryDir

        public java.io.File getRepositoryDir​(java.lang.String name)
        Get repository directory file for specified name
        Parameters:
        name - Repository name
        Returns:
        Repository directory file
      • getRepositoryDir

        public java.io.File getRepositoryDir​(ObjectDB mdl)
        Get repository directory file for specified name
        Parameters:
        mdl - Module
        Returns:
        Repository directory file
      • repositoryExists

        public boolean repositoryExists​(java.lang.String name)
        Check whether a repository exists for specified name
        Parameters:
        name - Repository name
        Returns:
        True if repository exists
      • repositoryExists

        public boolean repositoryExists​(ObjectDB mdl)
        Check whether a repository exists for specified name
        Parameters:
        mdl - Module
        Returns:
        True if repository exists
      • lsremote

        public java.lang.String lsremote​(java.lang.String uri,
                                         java.lang.String username,
                                         java.lang.String password)
                                  throws GitException
        Get list of remote repository refs
        Parameters:
        uri - Repository URI
        username - Optional username
        password - Optional password
        Returns:
        List of remote repository refs
        Throws:
        GitException
      • create

        public org.eclipse.jgit.api.Git create​(java.io.File dir)
                                        throws GitException
        Create a new repository
        Parameters:
        dir - Directory
        Returns:
        Git
        Throws:
        GitException
      • clone

        public void clone​(java.io.File dir,
                          java.lang.String uri,
                          java.lang.String username,
                          java.lang.String password,
                          java.lang.String remote,
                          java.lang.String branch)
                   throws GitException
        Clone an existing repository
        Parameters:
        dir - Directory to clone to
        uri - Repository URI
        username - Optional username
        password - Optional password
        remote - Optional remote (defaults to "origin")
        branch - Optional branch (defaults to "master")
        Throws:
        GitException
      • delete

        public java.lang.String delete​(ObjectDB mdl)
                                throws GitException
        Move the module's directory to the recylebin if it exists (or simply delete it if move is not successful)
        Parameters:
        mdl - Selected module
        Returns:
        Message telling whether the move/deletion was successful or not
        Throws:
        GitException
      • getFormat

        public java.lang.String getFormat​(java.lang.String module,
                                          java.lang.String defaultFormat)
        Get the commit format (json or xml) from module-info.json
        Parameters:
        module - Name
        defaultFormat - xml or json
        Returns:
        Commit format
      • isExploded

        public boolean isExploded​(java.lang.String module)
        Is the commit format (json or xml) exploded?
        this is checking the presence of the configuration folder
        Parameters:
        module - Name
        Returns:
        Exploded?
      • getCurrentBranchName

        public java.lang.String getCurrentBranchName​(java.io.File dir)
                                              throws GitException
        Get current branch name from an existing repository
        Parameters:
        dir - Directory
        Returns:
        Current branch name
        Throws:
        GitException
      • getCurrentBranchName

        public java.lang.String getCurrentBranchName​(ObjectDB mdl)
                                              throws GitException
        Get current branch name from an existing repository
        Parameters:
        mdl - Module
        Returns:
        Current branch name
        Throws:
        GitException
      • getLocalBranchNames

        public java.util.List<java.lang.String> getLocalBranchNames​(java.io.File dir)
                                                             throws GitException
        Get local branch names from an existing repository
        Parameters:
        dir - Directory
        Returns:
        List of branch names ([branch name]])
        Throws:
        GitException
      • getRemoteBranchNames

        public java.util.List<java.lang.String> getRemoteBranchNames​(java.io.File dir)
                                                              throws GitException
        Get remote branch names from an existing repository
        Parameters:
        dir - Directory
        Returns:
        List of remote branch names ([remote name]/[branch name]])
        Throws:
        GitException
      • getBranchNames

        public java.util.List<java.lang.String> getBranchNames​(java.io.File dir,
                                                               boolean local,
                                                               boolean remote)
                                                        throws GitException
        Get branch names from an existing repository
        Parameters:
        dir - Directory
        local - Local branches?
        remote - Remote branches?
        Returns:
        List of branch names ([branch name] for local branches, [remote name]/[branch name]] for remote branches names)
        Throws:
        GitException
      • getLocalBranchNames

        public java.util.List<java.lang.String> getLocalBranchNames​(org.eclipse.jgit.api.Git git)
                                                             throws GitException
        Get local branch names from an existing repository
        Parameters:
        git - Git
        Returns:
        List of branch names ([branch name]])
        Throws:
        GitException
      • getRemoteBranchNames

        public java.util.List<java.lang.String> getRemoteBranchNames​(org.eclipse.jgit.api.Git git)
                                                              throws GitException
        Get remote branch names from an existing repository
        Parameters:
        git - Git
        Returns:
        List of remote branch names ([remote name]/[branch name]])
        Throws:
        GitException
      • getBranchNames

        public java.util.List<java.lang.String> getBranchNames​(org.eclipse.jgit.api.Git git,
                                                               boolean local,
                                                               boolean remote)
                                                        throws GitException
        Get branch names from an existing repository
        Parameters:
        git - Git
        local - Local branches?
        remote - Remote branches?
        Returns:
        List of branch names ([branch name] for local branches, [remote name]/[branch name]] for remote branches names)
        Throws:
        GitException
      • getLocalBranchNames

        public java.util.List<java.lang.String> getLocalBranchNames​(ObjectDB mdl)
                                                             throws GitException
        Get local branch names from an existing repository
        Parameters:
        mdl - Module
        Returns:
        List of branch names ([branch name]])
        Throws:
        GitException
      • getRemoteBranchNames

        public java.util.List<java.lang.String> getRemoteBranchNames​(ObjectDB mdl)
                                                              throws GitException
        Get remote branch names from an existing repository
        Parameters:
        mdl - Module
        Returns:
        List of remote branch names ([remote name]/[branch name]])
        Throws:
        GitException
      • getBranchNames

        public java.util.List<java.lang.String> getBranchNames​(ObjectDB mdl,
                                                               boolean local,
                                                               boolean remote)
                                                        throws GitException
        Get branch names from an existing repository
        Parameters:
        mdl - Module
        local - Local branches?
        remote - Remote branches?
        Returns:
        List of branch names ([branch name] for local branches, [remote name]/[branch name]] for remote branches names)
        Throws:
        GitException
      • getRemoteNames

        public java.util.List<java.lang.String> getRemoteNames​(java.io.File dir)
                                                        throws GitException
        Get remote names from an existing repository
        Parameters:
        dir - Directory
        Returns:
        List of remote names
        Throws:
        GitException
      • getRemoteNames

        public java.util.List<java.lang.String> getRemoteNames​(ObjectDB mdl)
                                                        throws GitException
        Get remote names from an existing repository
        Parameters:
        mdl - Module
        Returns:
        List of remote names
        Throws:
        GitException
      • getRemoteNames

        public java.util.List<java.lang.String> getRemoteNames​(org.eclipse.jgit.api.Git git)
                                                        throws GitException
        Get remote names from an existing repository
        Parameters:
        git - Git
        Returns:
        List of remote names
        Throws:
        GitException
      • getRemoteURI

        public java.lang.String getRemoteURI​(java.io.File dir,
                                             java.lang.String name)
                                      throws GitException
        Get remote URI
        Parameters:
        dir - Directory
        name - Remote name return Remote URI
        Throws:
        GitException
      • addRemote

        public void addRemote​(java.io.File dir,
                              java.lang.String name,
                              java.lang.String uri)
                       throws GitException
        Add remote
        Parameters:
        dir - Directory
        name - Remote name to add
        uri - Remote URI
        Throws:
        GitException
      • removeRemote

        public void removeRemote​(java.io.File dir,
                                 java.lang.String name)
                          throws GitException
        Remove remote
        Parameters:
        dir - Directory
        name - Remote name to remove
        Throws:
        GitException
      • updateRemote

        public void updateRemote​(java.io.File dir,
                                 java.lang.String name,
                                 java.lang.String uri)
                          throws GitException
        Update remote
        Parameters:
        dir - Directory
        name - Remote name to update
        uri - Updated remote URI
        Throws:
        GitException
      • pull

        public boolean pull​(java.io.File dir,
                            java.lang.String username,
                            java.lang.String password,
                            java.lang.String remote)
                     throws GitException
        Pull from remote
        Parameters:
        dir - Directory
        username - Optional username
        password - Optional password
        remote - Remote name (defaults to "origin")
        Returns:
        True if pull is successful
        Throws:
        GitException
      • fetch

        public void fetch​(java.io.File dir,
                          java.lang.String username,
                          java.lang.String password,
                          java.lang.String remote)
                   throws GitException
        Fetch from remote
        Parameters:
        dir - Directory
        username - Optional username
        password - Optional password
        remote - Remote name (defaults to "origin")
        Throws:
        GitException
      • merge

        public boolean merge​(java.io.File dir,
                             java.lang.String remote)
                      throws GitException
        Merge
        Parameters:
        dir - Directory
        Returns:
        True if merge is successful
        Throws:
        GitException
      • revert

        public java.lang.String revert​(java.io.File dir)
                                throws GitException
        Revert last commit
        Parameters:
        dir - Directory
        Returns:
        Reverted commit ID
        Throws:
        GitException
      • push

        public void push​(java.io.File dir,
                         java.lang.String username,
                         java.lang.String password,
                         java.lang.String remote)
                  throws GitException
        Push to remote
        Parameters:
        dir - Directory
        username - Optional username
        password - Optional password
        remote - Remote name (defaults to "origin")
        Throws:
        GitException
      • clean

        public void clean​(ObjectDB mdl)
        Delete all files in the module's repository (excepted .git directory).
        Parameters:
        mdl - Module
      • clean

        public void clean​(java.io.File dir)
        Delete all files in the repository (excepted .git directory).
        Parameters:
        dir - Directory
      • reset

        public void reset​(ObjectDB mdl,
                          boolean hard)
                   throws GitException
        Reset the module's repository worktree.
        Parameters:
        mdl - Module
        hard - Hard reset?
        Throws:
        GitException
      • reset

        public void reset​(java.io.File dir,
                          boolean hard)
                   throws GitException
        Reset the repository worktree.
        Parameters:
        dir - Directory
        hard - Hard reset?
        Throws:
        GitException
      • checkout

        public void checkout​(ObjectDB mdl,
                             java.lang.String commitId)
                      throws GitException
        Checkout commit ID in the module's repository worktree.
        Parameters:
        mdl - Module
        commitId - Commit ID (defaults to "HEAD")
        Throws:
        GitException
      • checkout

        public void checkout​(java.io.File dir,
                             java.lang.String commitId)
                      throws GitException
        Checkout a commit ID in the repository worktree.
        Parameters:
        dir - Directory
        commitId - Commit ID (defaults to "HEAD")
        Throws:
        GitException
      • checkout

        public void checkout​(ObjectDB mdl,
                             java.lang.String branch,
                             boolean create,
                             java.lang.String remoteBranch)
                      throws GitException
        Checkout a branch in the module's repository worktree.
        Parameters:
        mdl - Module
        branch - Local branch name (defaults to "master")
        create - Create branch?
        remoteBranch - Name of a remote branch <remote name, e.g. origin>/<remote branch name> to track
        Throws:
        GitException
      • checkout

        public void checkout​(java.io.File dir,
                             java.lang.String branch,
                             boolean create,
                             java.lang.String remoteBranch)
                      throws GitException
        Checkout a branch in the repository worktree.
        Parameters:
        dir - Directory
        branch - Local branch name (defaults to "master")
        create - Create branch?
        remoteBranch - Name of a remote branch <remote name, e.g. origin>/<remote branch name> to track
        Throws:
        GitException
      • tag

        public void tag​(ObjectDB mdl,
                        java.lang.String tag,
                        java.lang.String commitId)
                 throws GitException
        Tag module's commit
        Parameters:
        mdl - Module
        tag - Tag
        commitId - Commit ID (null means last commit)
        Throws:
        GitException
      • tag

        public void tag​(java.io.File dir,
                        java.lang.String tag,
                        java.lang.String commitId)
                 throws GitException
        Tag commit
        Parameters:
        dir - Directory
        tag - Tag
        commitId - Commit ID (null means last commit)
        Throws:
        GitException
      • getTags

        public java.util.List<java.lang.String> getTags​(ObjectDB mdl,
                                                        java.lang.String commitId)
                                                 throws GitException
        Get all tags for a commit ID
        Parameters:
        mdl - Module
        commitId - Commit ID (null means last commit)
        Returns:
        List of tags
        Throws:
        GitException
      • getTags

        public java.util.List<java.lang.String> getTags​(java.io.File dir,
                                                        java.lang.String commitId)
                                                 throws GitException
        Get all tags for a commit ID
        Parameters:
        dir - Directory
        commitId - Commit ID (null means last commit)
        Returns:
        List of tags
        Throws:
        GitException
      • getPrevCommitId

        public java.lang.String getPrevCommitId​(org.eclipse.jgit.lib.Repository rep,
                                                java.lang.String commitId)
                                         throws GitException
        Get previous commit ID for specified commit ID
        Parameters:
        rep - Repository
        commitId - Commit ID
        Returns:
        Previous commit ID
        Throws:
        GitException
      • getPrevCommitId

        public java.lang.String getPrevCommitId​(ObjectDB mdl,
                                                java.lang.String commitId)
                                         throws GitException
        Get previous module's commit ID for specified commit ID
        Parameters:
        mdl - Module
        commitId - Commit ID
        Returns:
        Previous module's commit ID
        Throws:
        GitException
      • getDiff

        public org.json.JSONArray getDiff​(org.eclipse.jgit.lib.Repository rep,
                                          org.eclipse.jgit.lib.ObjectId oldCommitId,
                                          org.eclipse.jgit.lib.ObjectId newCommitId)
                                   throws GitException
        Get diff entries of 2 revisions
        Parameters:
        rep - Repository
        oldCommitId - Old commit object ID
        newCommitId - New commit object ID
        Returns:
        Diff entries as JSON array
        Throws:
        GitException
      • getDiff

        public org.json.JSONArray getDiff​(org.eclipse.jgit.lib.Repository rep,
                                          org.eclipse.jgit.revwalk.RevCommit oldCommit,
                                          org.eclipse.jgit.revwalk.RevCommit newCommit)
                                   throws GitException
        Get diff entries of 2 revisions
        Parameters:
        rep - Repository
        oldCommit - Old commit
        newCommit - New commit
        Returns:
        Diff entries as JSON array
        Throws:
        GitException
      • getRawDiff

        public java.lang.String getRawDiff​(org.eclipse.jgit.lib.Repository rep,
                                           org.eclipse.jgit.revwalk.RevCommit oldCommit,
                                           org.eclipse.jgit.revwalk.RevCommit newCommit)
                                    throws GitException
        Get raw diff of 2 revisions
        Parameters:
        rep - Repository
        oldCommit - Old commit
        newCommit - New commit
        Returns:
        Raw diff
        Throws:
        GitException
      • getRawDiff

        public java.lang.String getRawDiff​(org.eclipse.jgit.lib.Repository rep,
                                           java.lang.String commitId)
                                    throws GitException
        Get raw diff for specified commit ID
        Parameters:
        rep - Repository
        commitId - Commit ID
        Returns:
        Raw diff
        Throws:
        GitException
      • getRawDiff

        public java.lang.String getRawDiff​(ObjectDB mdl,
                                           java.lang.String commitId)
                                    throws GitException
        Get raw diff for specified commit ID
        Parameters:
        mdl - Module
        commitId - Commit ID
        Returns:
        Raw diff
        Throws:
        GitException
      • getLastCommitDiff

        public org.json.JSONArray getLastCommitDiff​(org.eclipse.jgit.lib.Repository rep)
                                             throws GitException
        Get last commit's diff entries
        Parameters:
        rep - Repository
        Returns:
        Last commit's diff entries as JSON array
        Throws:
        GitException
      • getAllCommits

        public org.json.JSONArray getAllCommits​(org.eclipse.jgit.lib.Repository rep,
                                                int n)
                                         throws GitException
        Get last commits information
        Parameters:
        rep - Repository
        n - Depth
        Returns:
        Last commits information as JSON array
        Throws:
        GitException
      • getAllCommits

        public org.json.JSONArray getAllCommits​(org.eclipse.jgit.lib.Repository rep,
                                                int start,
                                                int max)
                                         throws GitException
        Get last commits information
        Parameters:
        rep - Repository
        start - Start index
        max - Limit size
        Returns:
        Last commits information as JSON array
        Throws:
        GitException
      • getAllCommits

        public org.json.JSONArray getAllCommits​(org.eclipse.jgit.lib.Repository rep,
                                                int start,
                                                int max,
                                                java.lang.String name,
                                                java.lang.String message,
                                                java.lang.String user,
                                                java.lang.String email,
                                                java.lang.String dateMin,
                                                java.lang.String dateMax)
                                         throws GitException
        Get last commits information
        Parameters:
        rep - Repository
        start - Start index
        max - Limit size
        name - Optional name filter (regexp)
        message - Optional message filter (regexp)
        user - Optional user filter (regexp)
        email - Optional email filter (regexp)
        dateMin - Optional minimal date
        dateMax - Optional maximal date
        Returns:
        Last commits information as JSON array
        Throws:
        GitException
      • getAllModuleCommits

        public org.json.JSONArray getAllModuleCommits​(ObjectDB mdl,
                                                      int n)
                                               throws GitException
        Get modules's last commits information for module
        Parameters:
        mdl - Module
        n - Depth
        Returns:
        Modules's last commits information as JSON array
        Throws:
        GitException
      • getAllModuleCommits

        public org.json.JSONArray getAllModuleCommits​(ObjectDB mdl,
                                                      int start,
                                                      int max)
                                               throws GitException
        Get modules's last commits information for module
        Parameters:
        mdl - Module
        start - Start index
        max - Limit size
        Returns:
        Modules's last commits information as JSON array
        Throws:
        GitException
      • getAllModuleCommits

        public org.json.JSONArray getAllModuleCommits​(ObjectDB mdl,
                                                      int start,
                                                      int max,
                                                      java.lang.String name,
                                                      java.lang.String message,
                                                      java.lang.String user,
                                                      java.lang.String email,
                                                      java.lang.String dateMin,
                                                      java.lang.String dateMax)
                                               throws GitException
        Get modules's last commits information for module
        Parameters:
        mdl - Module
        start - Start index
        max - Limit size
        name - Optional name filter
        message - Optional message filter
        user - Optional user filter
        email - Optional email filter
        dateMin - Optional date filter
        dateMax - Optional date filter
        Returns:
        Modules's last commits information as JSON array
        Throws:
        GitException
      • countCommits

        public int countCommits​(ObjectDB mdl)
        Count commits in a module's repository
        Parameters:
        mdl - Module
        Returns:
        Number of commits
      • countCommits

        public int countCommits​(ObjectDB mdl,
                                java.lang.String name,
                                java.lang.String message,
                                java.lang.String user,
                                java.lang.String email,
                                java.lang.String dateMin,
                                java.lang.String dateMax)
        Count commits in a module's repository
        Parameters:
        mdl - Module
        name - Optional name filter
        message - Optional message filter
        user - Optional user filter
        email - Optional email filter
        dateMin - Optional date filter
        dateMax - Optional date filter
        Returns:
        Number of commits
      • countCommits

        public int countCommits​(org.eclipse.jgit.lib.Repository rep)
        Count commits in a repository
        Parameters:
        rep - Repository
        Returns:
        Number of commits
      • countCommits

        public int countCommits​(org.eclipse.jgit.lib.Repository rep,
                                java.lang.String name,
                                java.lang.String message,
                                java.lang.String user,
                                java.lang.String email,
                                java.lang.String dateMin,
                                java.lang.String dateMax)
        Count commits in a repository
        Parameters:
        rep - Repository
        name - Optional name filter
        message - Optional message filter
        user - Optional user filter
        email - Optional email filter
        dateMin - Optional date filter
        dateMax - Optional date filter
        Returns:
        Number of commits
      • dumpCommit

        public java.lang.String dumpCommit​(org.eclipse.jgit.lib.Repository rep,
                                           org.eclipse.jgit.lib.ObjectId commitId)
                                    throws GitException
        Dump commit information
        Parameters:
        rep - Repository
        commitId - Commit ID (null means last commit)
        Returns:
        Commit information as string
        Throws:
        GitException
      • dumpModuleCommit

        public java.lang.String dumpModuleCommit​(ObjectDB mdl,
                                                 org.eclipse.jgit.lib.ObjectId commitId)
                                          throws GitException
        Dump module's commit for specified row ID
        Parameters:
        mdl - Module
        commitId - Commit ID (null means last commit)
        Returns:
        Commit dump
        Throws:
        GitException
      • commitModule

        @Deprecated(forRemoval=false,
                    since="4.0")
        public java.lang.String commitModule​(ObjectDB mdl,
                                             java.lang.String msg)
                                      throws PlatformException
        Deprecated.
        Use commitModule with addtional format parameter
        Throws:
        PlatformException
      • commitModule

        public java.lang.String commitModule​(ObjectDB mdl,
                                             java.lang.String format,
                                             boolean exploded,
                                             java.lang.String msg)
                                      throws PlatformException
        Commit selected module
        Parameters:
        mdl - Module object
        format - Format xml or json
        exploded - Exploded configuration files?
        msg - Message
        Returns:
        Commit ID
        Throws:
        PlatformException
      • getModuleJSON

        public org.json.JSONObject getModuleJSON​(ObjectDB mdl)
                                          throws GitException
        Get JSON tree from a module
        Parameters:
        mdl - Module
        Returns:
        JSON tree with root module
        Throws:
        GitException
      • getModuleZIP

        public java.io.InputStream getModuleZIP​(ObjectDB mdl)
                                         throws GitException
        Get clean ZIP stream from a module
        Parameters:
        mdl - Module
        Returns:
        ZIP stream
        Throws:
        GitException
      • getModuleZIP

        public java.io.InputStream getModuleZIP​(Grant g,
                                                java.lang.String name)
                                         throws GitException
        Get clean ZIP stream from a module name
        Parameters:
        g - Grant
        name - Module name
        Returns:
        ZIP stream
        Throws:
        GitException
      • getModuleZIP

        @Deprecated(forRemoval=true,
                    since="5")
        public java.io.InputStream getModuleZIP​(Grant g,
                                                java.lang.String name,
                                                java.io.File dir)
                                         throws GitException
        Deprecated, for removal: This API element is subject to removal in a future version.
        Use FlowXML.getModuleZIPStreamFromDir
        Throws:
        GitException
      • getModuleFile

        @Deprecated(forRemoval=true,
                    since="5")
        public java.io.File getModuleFile​(Grant g,
                                          java.lang.String name,
                                          java.io.File dir)
                                   throws GitException
        Deprecated, for removal: This API element is subject to removal in a future version.
        Use FlowXML.getModuleZIPFileFromDir
        Throws:
        GitException
      • importModule

        @Deprecated(forRemoval=true,
                    since="5")
        public Message importModule​(ObjectDB mdl)
                             throws PlatformException
        Deprecated, for removal: This API element is subject to removal in a future version.
        Use commitModule with addtional format parameter
        Throws:
        PlatformException
      • importModule

        @Deprecated(forRemoval=true,
                    since="5")
        public Message importModule​(Grant g,
                                    java.io.File dir,
                                    org.json.JSONArray diffs)
                             throws PlatformException
        Deprecated, for removal: This API element is subject to removal in a future version.
        Use commitModule with addtional format parameter
        Throws:
        PlatformException
      • importModule

        public Message importModule​(Grant g,
                                    java.io.File dir,
                                    org.json.JSONArray diffs,
                                    boolean async)
                             throws PlatformException
        Import module from repository checkout
        Parameters:
        g - Grant
        dir - Repository directory
        diffs - Changes to process (if null a full import is forced)
        async - Asynchronous import? (only relevant for full import)
        Returns:
        Message
        Throws:
        PlatformException