org.eclipse.jgit.storage.file
Class FileRepositoryBuilder
java.lang.Object
org.eclipse.jgit.lib.BaseRepositoryBuilder<FileRepositoryBuilder,FileRepository>
org.eclipse.jgit.storage.file.FileRepositoryBuilder
public class FileRepositoryBuilder
- extends BaseRepositoryBuilder<FileRepositoryBuilder,FileRepository>
Constructs a FileRepository
.
Applications must set one of BaseRepositoryBuilder.setGitDir(File)
or
BaseRepositoryBuilder.setWorkTree(File)
, or use BaseRepositoryBuilder.readEnvironment()
or
BaseRepositoryBuilder.findGitDir()
in order to configure the minimum property set
necessary to open a repository.
Single repository applications trying to be compatible with other Git
implementations are encouraged to use a model such as:
new FileRepositoryBuilder() //
.setGitDir(gitDirArgument) // --git-dir if supplied, no-op if null
.readEnviroment() // scan environment GIT_* variables
.findGitDir() // scan up the file system tree
.build()
Method Summary |
FileRepository |
build()
Create a repository matching the configuration in this builder. |
Methods inherited from class org.eclipse.jgit.lib.BaseRepositoryBuilder |
addAlternateObjectDirectories, addAlternateObjectDirectories, addAlternateObjectDirectory, addCeilingDirectories, addCeilingDirectories, addCeilingDirectory, findGitDir, findGitDir, getAlternateObjectDirectories, getConfig, getFS, getGitDir, getIndexFile, getObjectDirectory, getWorkTree, isBare, isMustExist, loadConfig, readEnvironment, readEnvironment, requireGitDirOrWorkTree, safeFS, self, setBare, setFS, setGitDir, setIndexFile, setMustExist, setObjectDirectory, setup, setupGitDir, setupInternals, setupWorkTree, setWorkTree |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FileRepositoryBuilder
public FileRepositoryBuilder()
build
public FileRepository 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<FileRepositoryBuilder,FileRepository>
- 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.
Copyright © 2012. All Rights Reserved.