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>
DfsRepository
.Constructor and Description |
---|
DfsRepositoryBuilder() |
Modifier and Type | Method and Description |
---|---|
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.
|
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
public DfsReaderOptions getReaderOptions()
public B setReaderOptions(DfsReaderOptions opt)
opt
- new reader options object.this
public DfsRepositoryDescription getRepositoryDescription()
public B setRepositoryDescription(DfsRepositoryDescription desc)
desc
- new repository description object.this
public B setup() throws IllegalArgumentException, IOException
BaseRepositoryBuilder
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.
setup
in class BaseRepositoryBuilder<B extends DfsRepositoryBuilder,R extends DfsRepository>
this
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.public abstract R build() throws IOException
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.
build
in class BaseRepositoryBuilder<B extends DfsRepositoryBuilder,R extends DfsRepository>
IllegalArgumentException
- insufficient parameters were set.IOException
- the repository could not be accessed to configure the rest of
the builder's parameters.public B setGitDir(File gitDir)
BaseRepositoryBuilder
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
.
setGitDir
in class BaseRepositoryBuilder<B extends DfsRepositoryBuilder,R extends DfsRepository>
gitDir
- GIT_DIR
, the repository meta directory.this
(for chaining calls).public B setObjectDirectory(File objectDirectory)
BaseRepositoryBuilder
setObjectDirectory
in class BaseRepositoryBuilder<B extends DfsRepositoryBuilder,R extends DfsRepository>
objectDirectory
- GIT_OBJECT_DIRECTORY
, the directory where the
repository's object files are stored.this
(for chaining calls).public B addAlternateObjectDirectory(File other)
BaseRepositoryBuilder
This setting handles one alternate directory at a time, and is provided
to support GIT_ALTERNATE_OBJECT_DIRECTORIES
.
addAlternateObjectDirectory
in class BaseRepositoryBuilder<B extends DfsRepositoryBuilder,R extends DfsRepository>
other
- another objects directory to search after the standard one.this
(for chaining calls).public B setWorkTree(File workTree)
BaseRepositoryBuilder
setWorkTree
in class BaseRepositoryBuilder<B extends DfsRepositoryBuilder,R extends DfsRepository>
workTree
- GIT_WORK_TREE
, the working directory of the checkout.this
(for chaining calls).public B setIndexFile(File indexFile)
BaseRepositoryBuilder
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
.
setIndexFile
in class BaseRepositoryBuilder<B extends DfsRepositoryBuilder,R extends DfsRepository>
indexFile
- GIT_INDEX_FILE
, the index file location.this
(for chaining calls).Copyright © 2013. All rights reserved.