@NotThreadSafe public abstract class

AbstractScmCommandBuilder

extends AbstractCommandBuilder<B extends CommandBuilder<B>>
implements ScmCommandBuilder<B extends ScmCommandBuilder<B>>
java.lang.Object
   ↳ com.atlassian.bitbucket.scm.AbstractCommandBuilder<B extends com.atlassian.bitbucket.scm.CommandBuilder<B>>
     ↳ com.atlassian.bitbucket.scm.AbstractScmCommandBuilder<B extends com.atlassian.bitbucket.scm.ScmCommandBuilder<B>>

Class Overview

Extends AbstractCommandBuilder and provides a basic implementation of ScmCommandBuilder. As with AbstractCommandBuilder, build(CommandOutputHandler) must be implemented by the derived class.

Summary

Fields
protected String command The SCM command to run when the binary is executed, such as "clone" or "diff".
[Expand]
Inherited Fields
From class com.atlassian.bitbucket.scm.AbstractCommandBuilder
Protected Constructors
AbstractScmCommandBuilder(I18nService i18nService, String binary)
Constructs a new AbstractScmCommandBuilder and sets the I18nService to use for internationalising error messages and the binary to execute.
AbstractScmCommandBuilder(I18nService i18nService, String binary, File workingDirectory)
Constructs a new AbstractScmCommandBuilder, sets the I18nService to use for internationalising error messages and the binary to execute, and optionally sets the workingDirectory where it should be executed.
Public Methods
@Nonnull B command(String value)
Ensures the provided value is not blank and sets it as the command to run.
[Expand]
Inherited Methods
From class com.atlassian.bitbucket.scm.AbstractCommandBuilder
From class java.lang.Object
From interface com.atlassian.bitbucket.scm.CommandBuilder
From interface com.atlassian.bitbucket.scm.CommandBuilderSupport
From interface com.atlassian.bitbucket.scm.ScmCommandBuilder

Fields

protected String command

The SCM command to run when the binary is executed, such as "clone" or "diff". This field may be null, but when it is implementations should apply the first argument as the command when building the Command. If no command was set and there are no arguments, implementations are encouraged to throw an IllegalStateException.

See Also
  • ScmCommandBuilder#command(String)

Protected Constructors

protected AbstractScmCommandBuilder (I18nService i18nService, String binary)

Constructs a new AbstractScmCommandBuilder and sets the I18nService to use for internationalising error messages and the binary to execute.

Parameters
i18nService the I18nService for internationalising error messages
binary the binary to execute
Throws
IllegalArgumentException if the provided binary is empty or blank
NullPointerException if the provided i18nService or binary is null

protected AbstractScmCommandBuilder (I18nService i18nService, String binary, File workingDirectory)

Constructs a new AbstractScmCommandBuilder, sets the I18nService to use for internationalising error messages and the binary to execute, and optionally sets the workingDirectory where it should be executed.

Parameters
i18nService the I18nService for internationalising error messages
binary the binary to execute
workingDirectory the working directory for the command, or null for the default
Throws
IllegalArgumentException if the provided binary is empty or blank, or if a working directory is provided which does not exist or is not a directory
NullPointerException if the provided i18nService or binary is null

Public Methods

@Nonnull public B command (String value)

Ensures the provided value is not blank and sets it as the command to run.

Parameters
value the SCM command to execute
Returns