Package org.eclipse.jgit.api
Class RemoteSetUrlCommand
- java.lang.Object
-
- org.eclipse.jgit.api.GitCommand<RemoteConfig>
-
- org.eclipse.jgit.api.RemoteSetUrlCommand
-
- All Implemented Interfaces:
Callable<RemoteConfig>
public class RemoteSetUrlCommand extends GitCommand<RemoteConfig>
Used to change the URL of a remote. This class has setters for all supported options and arguments of this command and acall()method to finally execute the command.- Since:
- 4.2
- See Also:
- Git documentation about Remote
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRemoteSetUrlCommand.UriTypeThe available URI types for the remote.
-
Field Summary
-
Fields inherited from class org.eclipse.jgit.api.GitCommand
repo
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedRemoteSetUrlCommand(Repository repo)Constructor for RemoteSetUrlCommand.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description RemoteConfigcall()voidsetName(String name)Deprecated.usesetRemoteName(java.lang.String)insteadvoidsetPush(boolean push)Deprecated.RemoteSetUrlCommandsetRemoteName(String remoteName)The name of the remote to change the URL for.RemoteSetUrlCommandsetRemoteUri(URIish remoteUri)The new URL for the remote.voidsetUri(URIish uri)Deprecated.usesetRemoteUri(org.eclipse.jgit.transport.URIish)insteadRemoteSetUrlCommandsetUriType(RemoteSetUrlCommand.UriType type)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 Detail
-
RemoteSetUrlCommand
protected RemoteSetUrlCommand(Repository repo)
Constructor for RemoteSetUrlCommand.
- Parameters:
repo- theRepository
-
-
Method Detail
-
setName
@Deprecated public void setName(String name)
Deprecated.usesetRemoteName(java.lang.String)insteadThe name of the remote to change the URL for.- Parameters:
name- a remote name
-
setRemoteName
public RemoteSetUrlCommand setRemoteName(String remoteName)
The name of the remote to change the URL for.- Parameters:
remoteName- a remote remoteName- Returns:
this- Since:
- 5.3
-
setUri
@Deprecated public void setUri(URIish uri)
Deprecated.usesetRemoteUri(org.eclipse.jgit.transport.URIish)insteadThe new URL for the remote.- Parameters:
uri- an URL for the remote
-
setRemoteUri
public RemoteSetUrlCommand setRemoteUri(URIish remoteUri)
The new URL for the remote.- Parameters:
remoteUri- an URL for the remote- Returns:
this- Since:
- 5.3
-
setPush
@Deprecated public void setPush(boolean push)
Deprecated.Whether to change the push URL of the remote instead of the fetch URL.- Parameters:
push-trueto set the push url,falseto set the fetch url
-
setUriType
public RemoteSetUrlCommand setUriType(RemoteSetUrlCommand.UriType type)
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
public RemoteConfig call() throws GitAPIException
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
-
-