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

public Class LsRemoteCommand

extends TransportCommand<LsRemoteCommand, Collection<Ref>>
Class Inheritance
Imports
java.io.IOException, java.net.URISyntaxException, java.text.MessageFormat, java.util.ArrayList, .Collection, .Collections, .HashMap, .Map, org.eclipse.jgit.api.errors.GitAPIException, .InvalidRemoteException, .JGitInternalException, org.eclipse.jgit.errors.ConfigInvalidException, .NotSupportedException, org.eclipse.jgit.internal.JGitText, org.eclipse.jgit.lib.Constants, .Ref, .Repository, org.eclipse.jgit.transport.FetchConnection, .RefSpec, .Transport, .URIish, .UrlConfig, org.eclipse.jgit.util.SystemReader

The ls-remote command
See Also
Git documentation about ls-remote

Field Summary

Modifier and TypeField and Description
private boolean
private String
private boolean
private String
Inherited from org.eclipse.jgit.api.TransportCommand:
credentialsProvidertimeouttransportConfigCallback

Constructor Summary

AccessConstructor and Description
public
LsRemoteCommand(Repository
local repository or null for operation without local repository
repo
)

Constructor for LsRemoteCommand

Method Summary

Modifier and TypeMethod and Description
public Collection<Ref>
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 Map<String, Ref>

Returns:

a map from names to references in the remote repository
callAsMap
()

Same as call(), but return Map instead of Collection.

private Map<String, Ref>
public LsRemoteCommand

Returns:

this
setHeads
(boolean
whether to include refs/heads
heads
)

Include refs/heads in references results

public LsRemoteCommand

Returns:

this
setRemote
(String remote)

The remote (uri or name) used for the fetch operation.

public LsRemoteCommand

Returns:

this
setTags
(boolean
whether to include tags
tags
)

Include refs/tags in references results

public LsRemoteCommand

Returns:

this
setUploadPack
(String
the full path of executable providing the git-upload-pack service on remote host
uploadPack
)

The full path of git-upload-pack on the remote host

private String
Inherited from org.eclipse.jgit.api.TransportCommand:
configureconfigureselfsetCredentialsProvidersetTimeoutsetTransportConfigCallback

Field Detail

headsback to summary
private boolean heads
remoteback to summary
private String remote
tagsback to summary
private boolean tags
uploadPackback to summary
private String uploadPack

Constructor Detail

LsRemoteCommandback to summary
public LsRemoteCommand(Repository repo)

Constructor for LsRemoteCommand

Parameters
repo:Repository

local repository or null for operation without local repository

Method Detail

callback to summary
public Collection<Ref> call() throws GitAPIException, InvalidRemoteException, TransportException

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

Execute the LsRemote command with all the options and parameters collected by the setter methods (e.g. setHeads(boolean)) of this class. Each instance of this class should only be used for one invocation of the command. Don't call this method twice on an instance.

Returns:Collection<Ref>

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

computed result

Annotations
@Override
callAsMapback to summary
public Map<String, Ref> callAsMap() throws GitAPIException, InvalidRemoteException, TransportException

Same as call(), but return Map instead of Collection.

Returns:Map<String, Ref>

a map from names to references in the remote repository

Exceptions
GitAPIException:
or subclass thereof when an error occurs
InvalidRemoteException:
when called with an invalid remote uri
TransportException:
for errors that occurs during transport
Since
3.5
executeback to summary
private Map<String, Ref> execute() throws GitAPIException, InvalidRemoteException, TransportException
setHeadsback to summary
public LsRemoteCommand setHeads(boolean heads)

Include refs/heads in references results

Parameters
heads:boolean

whether to include refs/heads

Returns:LsRemoteCommand

this

setRemoteback to summary
public LsRemoteCommand setRemote(String remote)

The remote (uri or name) used for the fetch operation. If no remote is set, the default value of Constants.DEFAULT_REMOTE_NAME will be used.

Parameters
remote:String

a java.lang.String object.

Returns:LsRemoteCommand

this

See Also
Constants#DEFAULT_REMOTE_NAME
setTagsback to summary
public LsRemoteCommand setTags(boolean tags)

Include refs/tags in references results

Parameters
tags:boolean

whether to include tags

Returns:LsRemoteCommand

this

setUploadPackback to summary
public LsRemoteCommand setUploadPack(String uploadPack)

The full path of git-upload-pack on the remote host

Parameters
uploadPack:String

the full path of executable providing the git-upload-pack service on remote host

Returns:LsRemoteCommand

this

translateback to summary
private String translate(String uri) throws IOException, ConfigInvalidException