public class LsRemoteCommand extends TransportCommand<LsRemoteCommand,java.util.Collection<Ref>>
Modifier and Type | Field and Description |
---|---|
private boolean |
heads |
private java.lang.String |
remote |
private boolean |
tags |
private java.lang.String |
uploadPack |
credentialsProvider, timeout, transportConfigCallback
repo
Constructor and Description |
---|
LsRemoteCommand(Repository repo)
Constructor for LsRemoteCommand
|
Modifier and Type | Method and Description |
---|---|
java.util.Collection<Ref> |
call() |
java.util.Map<java.lang.String,Ref> |
callAsMap()
Same as
call() , but return Map instead of Collection. |
private java.util.Map<java.lang.String,Ref> |
execute() |
LsRemoteCommand |
setHeads(boolean heads)
Include refs/heads in references results
|
LsRemoteCommand |
setRemote(java.lang.String remote)
The remote (uri or name) used for the fetch operation.
|
LsRemoteCommand |
setTags(boolean tags)
Include refs/tags in references results
|
LsRemoteCommand |
setUploadPack(java.lang.String uploadPack)
The full path of git-upload-pack on the remote host
|
configure, configure, self, setCredentialsProvider, setTimeout, setTransportConfigCallback
checkCallable, getRepository, setCallable
private java.lang.String remote
private boolean heads
private boolean tags
private java.lang.String uploadPack
public LsRemoteCommand(Repository repo)
repo
- local repository or null for operation without local
repositorypublic LsRemoteCommand setRemote(java.lang.String remote)
Constants.DEFAULT_REMOTE_NAME
will
be used.remote
- a String
object.this
Constants.DEFAULT_REMOTE_NAME
public LsRemoteCommand setHeads(boolean heads)
heads
- whether to include refs/headsthis
public LsRemoteCommand setTags(boolean tags)
tags
- whether to include tagsthis
public LsRemoteCommand setUploadPack(java.lang.String uploadPack)
uploadPack
- the full path of executable providing the git-upload-pack
service on remote hostthis
public java.util.Collection<Ref> call() throws GitAPIException, InvalidRemoteException, TransportException
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.
call
in interface java.util.concurrent.Callable<java.util.Collection<Ref>>
call
in class GitCommand<java.util.Collection<Ref>>
GitAPIException
InvalidRemoteException
TransportException
public java.util.Map<java.lang.String,Ref> callAsMap() throws GitAPIException, InvalidRemoteException, TransportException
call()
, but return Map instead of Collection.GitAPIException
- or subclass thereof when an error occursInvalidRemoteException
- when called with an invalid remote uriTransportException
- for errors that occurs during transportprivate java.util.Map<java.lang.String,Ref> execute() throws GitAPIException, InvalidRemoteException, TransportException