Class DfsRepositoryBuilder<B extends DfsRepositoryBuilder,R extends DfsRepository>
- Type Parameters:
B
- type of the builder class.R
- type of the repository class.
- Direct Known Subclasses:
InMemoryRepository.Builder
DfsRepository
.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddAlternateObjectDirectory
(File other) Add an alternate object directory to the search list.abstract R
build()
Create a repository matching the configuration in this builder.Get options used by readers accessing the repository.Get the description of the repository.Set the Git directory storing the repository metadata.setIndexFile
(File indexFile) Set the local index file that is caching checked out file status.setObjectDirectory
(File objectDirectory) Set the directory storing the repository's objects.Set the reader options.Set the repository description.setup()
Guess and populate all parameters not already defined.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, getInitialBranch, getObjectDirectory, getWorkTree, isBare, isMustExist, loadConfig, readEnvironment, readEnvironment, requireGitDirOrWorkTree, safeFS, self, setBare, setFS, setInitialBranch, setMustExist, setupGitDir, setupInternals, setupWorkTree
-
Field Details
-
readerOptions
-
repoDesc
-
-
Constructor Details
-
DfsRepositoryBuilder
public DfsRepositoryBuilder()
-
-
Method Details
-
getReaderOptions
Get options used by readers accessing the repository.- Returns:
- options used by readers accessing the repository.
-
setReaderOptions
Set the reader options.- Parameters:
opt
- new reader options object.- Returns:
this
-
getRepositoryDescription
Get the description of the repository.- Returns:
- the description of the repository.
-
setRepositoryDescription
Set the repository description.- Parameters:
desc
- new repository description object.- Returns:
this
-
setup
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 classBaseRepositoryBuilder<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
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.
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 classBaseRepositoryBuilder<B extends DfsRepositoryBuilder,
R extends DfsRepository> - Returns:
- a repository matching this configuration. The caller is responsible to close the repository instance when it is no longer needed.
- Throws:
IOException
- the repository could not be accessed to configure the rest of the builder's parameters.
-
setGitDir
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. Ifnull
the path is assumed to beworkTree/.git
.- Overrides:
setGitDir
in classBaseRepositoryBuilder<B extends DfsRepositoryBuilder,
R extends DfsRepository> - Parameters:
gitDir
-GIT_DIR
, the repository meta directory.- Returns:
this
(for chaining calls).
-
setObjectDirectory
Set the directory storing the repository's objects.- Overrides:
setObjectDirectory
in classBaseRepositoryBuilder<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
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 classBaseRepositoryBuilder<B extends DfsRepositoryBuilder,
R extends DfsRepository> - Parameters:
other
- another objects directory to search after the standard one.- Returns:
this
(for chaining calls).
-
setWorkTree
Set the top level directory of the working files.- Overrides:
setWorkTree
in classBaseRepositoryBuilder<B extends DfsRepositoryBuilder,
R extends DfsRepository> - Parameters:
workTree
-GIT_WORK_TREE
, the working directory of the checkout.- Returns:
this
(for chaining calls).
-
setIndexFile
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 defaultgitDiir/index
.- Overrides:
setIndexFile
in classBaseRepositoryBuilder<B extends DfsRepositoryBuilder,
R extends DfsRepository> - Parameters:
indexFile
-GIT_INDEX_FILE
, the index file location.- Returns:
this
(for chaining calls).
-