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 class
RemoteSetUrlCommand.UriType
The available URI types for the remote.
-
Field Summary
-
Fields inherited from class org.eclipse.jgit.api.GitCommand
repo
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
RemoteSetUrlCommand(Repository repo)
Constructor for RemoteSetUrlCommand.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description RemoteConfig
call()
void
setName(String name)
Deprecated.usesetRemoteName(java.lang.String)
insteadvoid
setPush(boolean push)
Deprecated.RemoteSetUrlCommand
setRemoteName(String remoteName)
The name of the remote to change the URL for.RemoteSetUrlCommand
setRemoteUri(URIish remoteUri)
The new URL for the remote.void
setUri(URIish uri)
Deprecated.usesetRemoteUri(org.eclipse.jgit.transport.URIish)
insteadRemoteSetUrlCommand
setUriType(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
-true
to set the push url,false
to 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
- theUriType
value to set- Returns:
this
- Since:
- 5.3
-
call
public RemoteConfig call() throws GitAPIException
Execute the command
Executes the
remote
command with all the options and parameters collected by the setter methods of this class.- Specified by:
call
in interfaceCallable<RemoteConfig>
- Specified by:
call
in classGitCommand<RemoteConfig>
- Throws:
GitAPIException
-
-