- All Implemented Interfaces:
Callable<RemoteConfig>
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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe available URI types for the remote. -
Field Summary
Fields inherited from class org.eclipse.jgit.api.GitCommand
repo -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructor for RemoteSetUrlCommand. -
Method Summary
Modifier and TypeMethodDescriptioncall()setRemoteName(String remoteName) The name of the remote to change the URL for.setRemoteUri(URIish remoteUri) The new URL for the remote.Whether to change the push URL of the remote instead of the fetch URL.Methods inherited from class org.eclipse.jgit.api.GitCommand
checkCallable, getRepository, setCallable
-
Constructor Details
-
RemoteSetUrlCommand
Constructor for RemoteSetUrlCommand.
- Parameters:
repo- theRepository
-
-
Method Details
-
setRemoteName
The name of the remote to change the URL for.- Parameters:
remoteName- a remote remoteName- Returns:
this- Since:
- 5.3
-
setRemoteUri
The new URL for the remote.- Parameters:
remoteUri- an URL for the remote- Returns:
this- Since:
- 5.3
-
setUriType
Whether to change the push URL of the remote instead of the fetch URL.- Parameters:
type- theUriTypevalue to set- Returns:
this- Since:
- 5.3
-
call
Execute the command
Executes the
remotecommand with all the options and parameters collected by the setter methods of this class.- Specified by:
callin interfaceCallable<RemoteConfig>- Specified by:
callin classGitCommand<RemoteConfig>- Throws:
GitAPIException
-