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

public Class RemoteSetUrlCommand

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

Used to change the URL of a 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

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
RemoteSetUrlCommand.UriType

The available URI types for the remote.

Field Summary

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

Constructor Summary

AccessConstructor and Description
protected
RemoteSetUrlCommand(Repository repo)

Constructor for RemoteSetUrlCommand.

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 RemoteSetUrlCommand

Returns:

this
setRemoteName
(String
a remote remoteName
remoteName
)

The name of the remote to change the URL for.

public RemoteSetUrlCommand

Returns:

this
setRemoteUri
(URIish
an URL for the remote
remoteUri
)

The new URL for the remote.

public RemoteSetUrlCommand

Returns:

this
setUriType
(RemoteSetUrlCommand.UriType
the UriType value to set
type
)

Whether to change the push URL of the remote instead of the fetch URL.

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

Field Detail

remoteNameback to summary
private String remoteName
remoteUriback to summary
private URIish remoteUri
typeback to summary
private RemoteSetUrlCommand.UriType type

Constructor Detail

RemoteSetUrlCommandback to summary
protected RemoteSetUrlCommand(Repository repo)

Constructor for RemoteSetUrlCommand.

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 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
setRemoteNameback to summary
public RemoteSetUrlCommand setRemoteName(String remoteName)

The name of the remote to change the URL for.

Parameters
remoteName:String

a remote remoteName

Returns:RemoteSetUrlCommand

this

Since
5.3
setRemoteUriback to summary
public RemoteSetUrlCommand setRemoteUri(URIish remoteUri)

The new URL for the remote.

Parameters
remoteUri:URIish

an URL for the remote

Returns:RemoteSetUrlCommand

this

Since
5.3
setUriTypeback to summary
public RemoteSetUrlCommand setUriType(RemoteSetUrlCommand.UriType type)

Whether to change the push URL of the remote instead of the fetch URL.

Parameters
type:RemoteSetUrlCommand.UriType

the UriType value to set

Returns:RemoteSetUrlCommand

this

Since
5.3
org.eclipse.jgit.api back to summary

public final Enum RemoteSetUrlCommand.UriType

extends Enum<RemoteSetUrlCommand.UriType>
Class Inheritance

The available URI types for the remote.
Since
5.3

Field Summary

Modifier and TypeField and Description
public static final RemoteSetUrlCommand.UriType
FETCH

Fetch URL for the remote.

public static final RemoteSetUrlCommand.UriType
PUSH

Push URL for the remote.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static RemoteSetUrlCommand.UriType
public static RemoteSetUrlCommand.UriType[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

FETCHback to summary
public static final RemoteSetUrlCommand.UriType FETCH

Fetch URL for the remote.

PUSHback to summary
public static final RemoteSetUrlCommand.UriType PUSH

Push URL for the remote.

Constructor Detail

UriTypeback to summary
private UriType()

Method Detail

valueOfback to summary
public static RemoteSetUrlCommand.UriType valueOf(String name)
valuesback to summary
public static RemoteSetUrlCommand.UriType[] values()