Class MirrorSyncCommandParameters.Builder

java.lang.Object
com.atlassian.bitbucket.scm.mirror.MirrorSyncCommandParameters.Builder
Enclosing class:
MirrorSyncCommandParameters

public static class MirrorSyncCommandParameters.Builder extends Object
  • Constructor Details

    • Builder

      public Builder(@Nonnull String remoteUrl)
      Parameters:
      remoteUrl - the URL to fetch from
    • Builder

      public Builder(@Nonnull MirrorSyncCommandParameters mirrorSyncCommandParameters)
      Parameters:
      mirrorSyncCommandParameters - to copy
      Since:
      6.7
  • Method Details

    • anonymous

      @Nonnull public MirrorSyncCommandParameters.Builder anonymous(boolean value)
      If no credentials are to be provided, set this to true. If no credentials are provided, and anonymous is not set to true, then an IllegalArgumentException will be thrown. Similarly, if credentials are provided, but anonymous is set to true then an IllegalArgumentException will be thrown.
      Parameters:
      value - whether or not the sync command should provide credentials
      Returns:
      this
      Since:
      6.10
    • atomic

      @Nonnull public MirrorSyncCommandParameters.Builder atomic(boolean value)
      Parameters:
      value - true if the refs should be updated atomically (all refs updated successfully, or none); if not set, this defaults to false
      Returns:
      this
      Since:
      8.0
    • build

      @Nonnull public MirrorSyncCommandParameters build()
    • includePrivateRefs

      @Nonnull public MirrorSyncCommandParameters.Builder includePrivateRefs(boolean value)
      If an explicit refspec is set then this setting is ignored.
      Parameters:
      value - whether to include private refs (outside refs/heads and refs/tags) in the fetch. The default value is true so all refs will be fetched.
      Returns:
      this
      Since:
      5.1
    • password

      @Nonnull public MirrorSyncCommandParameters.Builder password(@Nonnull String value)
      Parameters:
      value - the password to use
      Returns:
      this
      Since:
      4.6
    • privateKey

      @Nonnull public MirrorSyncCommandParameters.Builder privateKey(@Nonnull File value)
      Parameters:
      value - the SSH private key to use for authentication
      Returns:
      this
    • privateKey

      @Nonnull public MirrorSyncCommandParameters.Builder privateKey(@Nonnull Path value)
      Parameters:
      value - the SSH private key to use for authentication
      Returns:
      this
      Since:
      5.12
    • prune

      @Nonnull public MirrorSyncCommandParameters.Builder prune(boolean value)
      Specifies whether to supply --prune to prune local branches and tags where the upstream branch or tag has been deleted.
      Parameters:
      value - true if pruning should be enabled
      Returns:
      the builder
      Since:
      6.7
    • refspecs

      @Nonnull public MirrorSyncCommandParameters.Builder refspecs(@Nonnull Iterable<String> values)
      Parameters:
      values - refspecs to be passed to the fetch command
      Returns:
      the builder
      Since:
      6.7
    • username

      @Nonnull public MirrorSyncCommandParameters.Builder username(@Nonnull String value)
      Parameters:
      value - the username to use
      Returns:
      this
      Since:
      4.6
    • withEnvironment

      @Nonnull public MirrorSyncCommandParameters.Builder withEnvironment(@Nonnull String name, @Nonnull String value)
      Puts the provided value in the environment map with the specified name, after ensuring both the name and value are not blank.
      Parameters:
      name - the name of the environment variable to set
      value - the value to set for the environment variable
      Returns:
      the builder
      Since:
      6.7
    • withTags

      @Nonnull public MirrorSyncCommandParameters.Builder withTags(boolean value)
      If using a refspec that includes tags this must be set to false or the fetch command will fail.
      Parameters:
      value - whether to include tags from the fetch unless included explicitly in a refspec.
      Returns:
      the builder
      Since:
      6.7