Class ScmContentProvider

    • Constructor Detail

      • ScmContentProvider

        public ScmContentProvider()
    • Method Detail

      • getScmId

        @Nonnull
        public abstract String getScmId()
        Get the "scmId" for the content provider as defined in Scm.getId()
        Returns:
        SCM identifier
      • getApiUrl

        @CheckForNull
        public abstract String getApiUrl​(@Nonnull
                                         Item item)
        Get the SCM API URL for the provided item
        Parameters:
        item - Item item to resolve backing SCM API URL
        Returns:
        SCM API URL
      • getContent

        @CheckForNull
        public abstract Object getContent​(@Nonnull
                                          org.kohsuke.stapler.StaplerRequest staplerRequest,
                                          @Nonnull
                                          Item item)
        Gives content of scm file.
        Parameters:
        staplerRequest - StaplerRequest request specific to this SCM
        item - Item in context. e.g. OrganizationFolder or MultiBranchProject
        Returns:
        scm content
      • saveContent

        @CheckForNull
        public abstract Object saveContent​(@Nonnull
                                           org.kohsuke.stapler.StaplerRequest staplerRequest,
                                           @Nonnull
                                           Item item)
        Save content
        Parameters:
        staplerRequest - StaplerRequest request specific to this SCM
        item - Item in context. e.g. OrganizationFolder or MultiBranchProject
        Returns:
        SCM specific save content response
      • support

        public abstract boolean support​(@Nonnull
                                        Item item)
        ScmContentProvider instance that supports given SCMNavigator.
        Returns:
        true if this provide can handle it.