Package com.google.gerrit.server.git
Class LocalDiskRepositoryManager
java.lang.Object
com.google.gerrit.server.git.LocalDiskRepositoryManager
- All Implemented Interfaces:
GitRepositoryManager
- Direct Known Subclasses:
MultiBaseLocalDiskRepositoryManager
Manages Git repositories stored on the local filesystem.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classprotected classNested classes/interfaces inherited from interface com.google.gerrit.server.git.GitRepositoryManager
GitRepositoryManager.Status -
Method Summary
Modifier and TypeMethodDescriptionCheck if garbage collection can be performed by the repository manager.org.eclipse.jgit.lib.RepositoryCreate (and open) a repository by name.getBasePath(Project.NameKey name) Return the basePath under which the specified project is stored.GetGitRepositoryManager.Statusof the repository by name.list()Returns set of all known projects, sorted by natural NameKey order.org.eclipse.jgit.lib.RepositoryGet (or open) a repository by name.voidPerform the necessary cleanup when a repository has been removed.protected void
-
Method Details
-
getBasePath
Return the basePath under which the specified project is stored.- Parameters:
name- the name of the project- Returns:
- base directory
-
getRepositoryStatus
Description copied from interface:GitRepositoryManagerGetGitRepositoryManager.Statusof the repository by name.- Specified by:
getRepositoryStatusin interfaceGitRepositoryManager
-
openRepository
public org.eclipse.jgit.lib.Repository openRepository(Project.NameKey name) throws org.eclipse.jgit.errors.RepositoryNotFoundException Description copied from interface:GitRepositoryManagerGet (or open) a repository by name.- Specified by:
openRepositoryin interfaceGitRepositoryManager- Parameters:
name- the repository name, relative to the base directory.- Returns:
- the cached Repository instance. Caller must call
close()when done to decrement the resource handle. - Throws:
org.eclipse.jgit.errors.RepositoryNotFoundException- the name does not denote an existing repository.
-
createRepository
public org.eclipse.jgit.lib.Repository createRepository(Project.NameKey name) throws org.eclipse.jgit.errors.RepositoryNotFoundException, RepositoryExistsException, IOException Description copied from interface:GitRepositoryManagerCreate (and open) a repository by name.- Specified by:
createRepositoryin interfaceGitRepositoryManager- Parameters:
name- the repository name, relative to the base directory.- Returns:
- the cached Repository instance. Caller must call
close()when done to decrement the resource handle. - Throws:
org.eclipse.jgit.errors.RepositoryNotFoundException- the name is invalid.RepositoryExistsException- repository exists.IOException- the repository cannot be created.
-
canPerformGC
Description copied from interface:GitRepositoryManagerCheck if garbage collection can be performed by the repository manager.- Specified by:
canPerformGCin interfaceGitRepositoryManager- Returns:
- true if repository can perform garbage collection.
-
list
Description copied from interface:GitRepositoryManagerReturns set of all known projects, sorted by natural NameKey order.- Specified by:
listin interfaceGitRepositoryManager
-
repositoryDeleted
Description copied from interface:GitRepositoryManagerPerform the necessary cleanup when a repository has been removed.- Specified by:
repositoryDeletedin interfaceGitRepositoryManager- Parameters:
name- – the repository name, relative to the base directory.
-
scanProjects
-