Top Description Constructors Methods
org.eclipse.jgit.storage.file

public Class FileRepositoryBuilder

extends BaseRepositoryBuilder<FileRepositoryBuilder, Repository>
Class Inheritance
Imports
java.io.File, .IOException, org.eclipse.jgit.errors.RepositoryNotFoundException, org.eclipse.jgit.internal.storage.file.FileRepository, org.eclipse.jgit.lib.BaseRepositoryBuilder, .Repository

Constructs a org.eclipse.jgit.internal.storage.file.FileRepository.

Applications must set one of setGitDir(File) or setWorkTree(File), or use readEnvironment() or 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
		.readEnvironment() // scan environment GIT_* variables
		.findGitDir() // scan up the file system tree
		.build()

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Repository
build()

Overrides org.eclipse.jgit.lib.BaseRepositoryBuilder.build.

Create a repository matching the configuration in this builder.

public static Repository

Returns:

a repository matching this configuration.
create
(File
GIT_DIR, the repository meta directory.
gitDir
)

Convenience factory method to construct a org.eclipse.jgit.internal.storage.file.FileRepository.

Inherited from org.eclipse.jgit.lib.BaseRepositoryBuilder:
addAlternateObjectDirectoriesaddAlternateObjectDirectoriesaddAlternateObjectDirectoryaddCeilingDirectoriesaddCeilingDirectoriesaddCeilingDirectoryfindGitDirfindGitDirgetAlternateObjectDirectoriesgetConfiggetFSgetGitCommonDirgetGitDirgetIndexFilegetInitialBranchgetObjectDirectorygetWorkTreeisBareisMustExistloadConfigreadEnvironmentreadEnvironmentrequireGitDirOrWorkTreesafeFSselfsetBaresetFSsetGitCommonDirsetGitDirsetIndexFilesetInitialBranchsetMustExistsetObjectDirectorysetupsetupCommonDirsetupGitDirsetupInternalssetupWorkTreesetWorkTree

Constructor Detail

FileRepositoryBuilderback to summary
public FileRepositoryBuilder()

Method Detail

buildback to summary
public Repository build() throws IOException

Overrides org.eclipse.jgit.lib.BaseRepositoryBuilder.build.

Doc from org.eclipse.jgit.lib.BaseRepositoryBuilder.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.

Returns:Repository

a repository matching this configuration. The caller is responsible to close the repository instance when it is no longer needed.

Annotations
@Override
Exceptions
IOException:
the repository could not be accessed to configure the rest of the builder's parameters.
Since
3.0
createback to summary
public static Repository create(File gitDir) throws IOException

Convenience factory method to construct a org.eclipse.jgit.internal.storage.file.FileRepository.

Parameters
gitDir:File

GIT_DIR, the repository meta directory.

Returns:Repository

a repository matching this configuration.

Exceptions
IOException:
the repository could not be accessed to configure the rest of the builder's parameters.
Since
3.0