org.eclipse.jgit.api
Class SubmoduleAddCommand

java.lang.Object
  extended by org.eclipse.jgit.api.GitCommand<T>
      extended by org.eclipse.jgit.api.TransportCommand<SubmoduleAddCommand,Repository>
          extended by org.eclipse.jgit.api.SubmoduleAddCommand
All Implemented Interfaces:
Callable<Repository>

public class SubmoduleAddCommand
extends TransportCommand<SubmoduleAddCommand,Repository>

A class used to execute a submodule add command. This will clone the configured submodule, register the submodule in the .gitmodules file and the repository config file, and also add the submodule and .gitmodules file to the index.

See Also:
Git documentation about submodules

Field Summary
 
Fields inherited from class org.eclipse.jgit.api.TransportCommand
credentialsProvider, timeout, transportConfigCallback
 
Fields inherited from class org.eclipse.jgit.api.GitCommand
repo
 
Constructor Summary
SubmoduleAddCommand(Repository repo)
           
 
Method Summary
 Repository call()
          Executes the command
 SubmoduleAddCommand setPath(String path)
          Set repository-relative path of submodule
 SubmoduleAddCommand setProgressMonitor(ProgressMonitor monitor)
          The progress monitor associated with the clone operation.
 SubmoduleAddCommand setURI(String uri)
          Set URI to clone submodule from
protected  boolean submoduleExists()
          Is the configured already a submodule in the index?
 
Methods inherited from class org.eclipse.jgit.api.TransportCommand
configure, configure, self, setCredentialsProvider, setTimeout, setTransportConfigCallback
 
Methods inherited from class org.eclipse.jgit.api.GitCommand
checkCallable, getRepository, setCallable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SubmoduleAddCommand

public SubmoduleAddCommand(Repository repo)
Parameters:
repo -
Method Detail

setPath

public SubmoduleAddCommand setPath(String path)
Set repository-relative path of submodule

Parameters:
path -
Returns:
this command

setURI

public SubmoduleAddCommand setURI(String uri)
Set URI to clone submodule from

Parameters:
uri -
Returns:
this command

setProgressMonitor

public SubmoduleAddCommand setProgressMonitor(ProgressMonitor monitor)
The progress monitor associated with the clone operation. By default, this is set to NullProgressMonitor

Parameters:
monitor -
Returns:
this command
See Also:
NullProgressMonitor

submoduleExists

protected boolean submoduleExists()
                           throws IOException
Is the configured already a submodule in the index?

Returns:
true if submodule exists in index, false otherwise
Throws:
IOException

call

public Repository call()
                throws GitAPIException
Description copied from class: GitCommand
Executes the command

Specified by:
call in interface Callable<Repository>
Specified by:
call in class GitCommand<Repository>
Returns:
T a result. Each command has its own return type
Throws:
GitAPIException - or subclass thereof when an error occurs


Copyright © 2012. All Rights Reserved.