org.eclipse.jgit.storage.dfs
Class DfsRepositoryBuilder<B extends DfsRepositoryBuilder,R extends DfsRepository>

java.lang.Object
  extended by org.eclipse.jgit.lib.BaseRepositoryBuilder<B,R>
      extended by org.eclipse.jgit.storage.dfs.DfsRepositoryBuilder<B,R>
Type Parameters:
B - type of the builder class.
R - type of the repository class.

public abstract class DfsRepositoryBuilder<B extends DfsRepositoryBuilder,R extends DfsRepository>
extends BaseRepositoryBuilder<B,R>

Constructs a DfsRepository.


Constructor Summary
DfsRepositoryBuilder()
           
 
Method Summary
 B addAlternateObjectDirectory(File other)
          Add an alternate object directory to the search list.
abstract  R build()
          Create a repository matching the configuration in this builder.
 DfsReaderOptions getReaderOptions()
           
 DfsRepositoryDescription getRepositoryDescription()
           
 B setGitDir(File gitDir)
          Set the Git directory storing the repository metadata.
 B setIndexFile(File indexFile)
          Set the local index file that is caching checked out file status.
 B setObjectDirectory(File objectDirectory)
          Set the directory storing the repository's objects.
 B setReaderOptions(DfsReaderOptions opt)
          Set the reader options.
 B setRepositoryDescription(DfsRepositoryDescription desc)
          Set the repository description.
 B setup()
          Guess and populate all parameters not already defined.
 B setWorkTree(File workTree)
          Set the top level directory of the working files.
 
Methods inherited from class org.eclipse.jgit.lib.BaseRepositoryBuilder
addAlternateObjectDirectories, addAlternateObjectDirectories, addCeilingDirectories, addCeilingDirectories, addCeilingDirectory, findGitDir, findGitDir, getAlternateObjectDirectories, getConfig, getFS, getGitDir, getIndexFile, getObjectDirectory, getWorkTree, isBare, isMustExist, loadConfig, readEnvironment, readEnvironment, requireGitDirOrWorkTree, safeFS, self, setBare, setFS, setMustExist, setupGitDir, setupInternals, setupWorkTree
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DfsRepositoryBuilder

public DfsRepositoryBuilder()
Method Detail

getReaderOptions

public DfsReaderOptions getReaderOptions()
Returns:
options used by readers accessing the repository.

setReaderOptions

public B setReaderOptions(DfsReaderOptions opt)
Set the reader options.

Parameters:
opt - new reader options object.
Returns:
this

getRepositoryDescription

public DfsRepositoryDescription getRepositoryDescription()
Returns:
a description of the repository.

setRepositoryDescription

public B setRepositoryDescription(DfsRepositoryDescription desc)
Set the repository description.

Parameters:
desc - new repository description object.
Returns:
this

setup

public B setup()
                                     throws IllegalArgumentException,
                                            IOException
Description copied from class: BaseRepositoryBuilder
Guess and populate all parameters not already defined.

If an option was not set, the setup method will try to default the option based on other options. If insufficient information is available, an exception is thrown to the caller.

Overrides:
setup in class BaseRepositoryBuilder<B extends DfsRepositoryBuilder,R extends DfsRepository>
Returns:
this
Throws:
IllegalArgumentException - insufficient parameters were set, or some parameters are incompatible with one another.
IOException - the repository could not be accessed to configure the rest of the builder's parameters.

build

public abstract R build()
                                       throws IOException
Create a repository matching the configuration in this builder.

If an option was not set, the build method will try to default the option based on other options. If insufficient information is available, an exception is thrown to the caller.

Overrides:
build in class BaseRepositoryBuilder<B extends DfsRepositoryBuilder,R extends DfsRepository>
Returns:
a repository matching this configuration.
Throws:
IllegalArgumentException - insufficient parameters were set.
IOException - the repository could not be accessed to configure the rest of the builder's parameters.

setGitDir

public B setGitDir(File gitDir)
Description copied from class: BaseRepositoryBuilder
Set the Git directory storing the repository metadata.

The meta directory stores the objects, references, and meta files like MERGE_HEAD, or the index file. If null the path is assumed to be workTree/.git.

Overrides:
setGitDir in class BaseRepositoryBuilder<B extends DfsRepositoryBuilder,R extends DfsRepository>
Parameters:
gitDir - GIT_DIR, the repository meta directory.
Returns:
this (for chaining calls).

setObjectDirectory

public B setObjectDirectory(File objectDirectory)
Description copied from class: BaseRepositoryBuilder
Set the directory storing the repository's objects.

Overrides:
setObjectDirectory in class BaseRepositoryBuilder<B extends DfsRepositoryBuilder,R extends DfsRepository>
Parameters:
objectDirectory - GIT_OBJECT_DIRECTORY, the directory where the repository's object files are stored.
Returns:
this (for chaining calls).

addAlternateObjectDirectory

public B addAlternateObjectDirectory(File other)
Description copied from class: BaseRepositoryBuilder
Add an alternate object directory to the search list.

This setting handles one alternate directory at a time, and is provided to support GIT_ALTERNATE_OBJECT_DIRECTORIES.

Overrides:
addAlternateObjectDirectory in class BaseRepositoryBuilder<B extends DfsRepositoryBuilder,R extends DfsRepository>
Parameters:
other - another objects directory to search after the standard one.
Returns:
this (for chaining calls).

setWorkTree

public B setWorkTree(File workTree)
Description copied from class: BaseRepositoryBuilder
Set the top level directory of the working files.

Overrides:
setWorkTree in class BaseRepositoryBuilder<B extends DfsRepositoryBuilder,R extends DfsRepository>
Parameters:
workTree - GIT_WORK_TREE, the working directory of the checkout.
Returns:
this (for chaining calls).

setIndexFile

public B setIndexFile(File indexFile)
Description copied from class: BaseRepositoryBuilder
Set the local index file that is caching checked out file status.

The location of the index file tracking the status information for each checked out file in workTree. This may be null to assume the default gitDiir/index.

Overrides:
setIndexFile in class BaseRepositoryBuilder<B extends DfsRepositoryBuilder,R extends DfsRepository>
Parameters:
indexFile - GIT_INDEX_FILE, the index file location.
Returns:
this (for chaining calls).


Copyright © 2012. All Rights Reserved.