Interface CommitPatchBuilder


  • public interface CommitPatchBuilder
    Interface for creating commits in VCS. TeamCity calls its methods to add changes to the commit, when all changes are added commit(CommitSettings) method is invoked.
    Since:
    9.0
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      CommitResult commit​(CommitSettings commitSettings)
      Creates new commit with specified user name and description message
      void createDirectory​(String path)
      Creates an empty directory at the given relative path from a repository root
      void createFile​(String path, InputStream content)
      Adds the specified content at the given relative path from a repository root
      void deleteDirectory​(String path)
      Recursively deletes a directory at the given relative path from a repository root
      void deleteFile​(String path)
      Deletes a file at the given relative path from a repository root
      void dispose()
      Always called by TeamCity after was performed, or any of the methods above throw an exception
      void renameFile​(String oldPath, String newPath, InputStream content)
      Moves a file at the oldPath relative path from a repository root to a newPath and writes a new file content
    • Method Detail

      • createFile

        void createFile​(@NotNull
                        String path,
                        @NotNull
                        InputStream content)
                 throws VcsException
        Adds the specified content at the given relative path from a repository root
        Parameters:
        path - file path
        content - file content
        Throws:
        VcsException - in case of any problems
      • createDirectory

        void createDirectory​(@NotNull
                             String path)
                      throws VcsException
        Creates an empty directory at the given relative path from a repository root
        Parameters:
        path - directory path
        Throws:
        VcsException - in case of any problems
      • deleteFile

        void deleteFile​(@NotNull
                        String path)
                 throws VcsException
        Deletes a file at the given relative path from a repository root
        Parameters:
        path - file path
        Throws:
        VcsException - in case of any problems
      • deleteDirectory

        void deleteDirectory​(@NotNull
                             String path)
                      throws VcsException
        Recursively deletes a directory at the given relative path from a repository root
        Parameters:
        path - directory path
        Throws:
        VcsException - in case of any problems
      • renameFile

        void renameFile​(@NotNull
                        String oldPath,
                        @NotNull
                        String newPath,
                        @NotNull
                        InputStream content)
                 throws VcsException
        Moves a file at the oldPath relative path from a repository root to a newPath and writes a new file content
        Parameters:
        oldPath - old file path
        newPath - new file path
        content - file content
        Throws:
        VcsException - in case of any problems
      • commit

        @NotNull
        CommitResult commit​(@NotNull
                            CommitSettings commitSettings)
                     throws VcsException
        Creates new commit with specified user name and description message
        Parameters:
        commitSettings - settings of the commit to make
        Returns:
        result of commit operation
        Throws:
        VcsException - if commit failed
      • dispose

        void dispose()
        Always called by TeamCity after was performed, or any of the methods above throw an exception