Top Description Fields Constructors Methods
org.eclipse.jgit.api

public Class RemoteAddCommand

extends GitCommand<RemoteConfig>
Class Inheritance
Imports
java.io.IOException, java.net.URISyntaxException, org.eclipse.jgit.api.errors.GitAPIException, .JGitInternalException, org.eclipse.jgit.lib.Constants, .Repository, .StoredConfig, org.eclipse.jgit.transport.RefSpec, .RemoteConfig, .URIish

Used to add a new remote. This class has setters for all supported options and arguments of this command and a call() method to finally execute the command.
Since
4.2
See Also
Git documentation about Remote

Field Summary

Modifier and TypeField and Description
private String
private URIish
Inherited from org.eclipse.jgit.api.GitCommand:
repo

Constructor Summary

AccessConstructor and Description
protected
RemoteAddCommand(Repository repo)

Constructor for RemoteAddCommand.

Method Summary

Modifier and TypeMethod and Description
public RemoteConfig
call()

Implements abstract org.eclipse.jgit.api.GitCommand.call.

Implements java.util.concurrent.Callable.call.

Computes a result, or throws an exception if unable to do so.

public RemoteAddCommand

Returns:

this instance
setName
(String
a remote name
name
)

The name of the remote to add.

public RemoteAddCommand

Returns:

this instance
setUri
(URIish
an URL for the remote
uri
)

The URL of the repository for the new remote.

Inherited from org.eclipse.jgit.api.GitCommand:
checkCallablegetRepositorysetCallable

Field Detail

nameback to summary
private String name
uriback to summary
private URIish uri

Constructor Detail

RemoteAddCommandback to summary
protected RemoteAddCommand(Repository repo)

Constructor for RemoteAddCommand.

Parameters
repo:Repository

the org.eclipse.jgit.lib.Repository

Method Detail

callback to summary
public RemoteConfig call() throws GitAPIException

Implements abstract org.eclipse.jgit.api.GitCommand.call.

Implements java.util.concurrent.Callable.call.

Doc from org.eclipse.jgit.api.GitCommand.call.

Computes a result, or throws an exception if unable to do so.

Execute the command

Executes the remote add command with all the options and parameters collected by the setter methods of this class.

Returns:RemoteConfig

Doc from java.util.concurrent.Callable.call.

computed result

Annotations
@Override
setNameback to summary
public RemoteAddCommand setName(String name)

The name of the remote to add.

Parameters
name:String

a remote name

Returns:RemoteAddCommand

this instance

Since
5.0
setUriback to summary
public RemoteAddCommand setUri(URIish uri)

The URL of the repository for the new remote.

Parameters
uri:URIish

an URL for the remote

Returns:RemoteAddCommand

this instance

Since
5.0