Class ScmContentProvider

java.lang.Object
io.jenkins.blueocean.rest.impl.pipeline.ScmContentProvider
All Implemented Interfaces:
ExtensionPoint
Direct Known Subclasses:
AbstractScmContentProvider

public abstract class ScmContentProvider extends Object implements ExtensionPoint
SCM content specific APIs
Author:
Vivek Pandey
  • Constructor Details

    • ScmContentProvider

      public ScmContentProvider()
  • Method Details

    • 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.
    • resolve

      public static ScmContentProvider resolve(@NonNull Item item)
      Resolve ScmContentProvider for given Item.
      Parameters:
      item - item for which ScmContentProvider is resolved
      Returns:
      resolved ScmContentProvider
    • all

      public static ExtensionList<ScmContentProvider> all()