public class LocalDiskRepositoryManager extends java.lang.Object implements GitRepositoryManager, com.google.gerrit.extensions.events.LifecycleListener
Modifier and Type | Class and Description |
---|---|
static class |
LocalDiskRepositoryManager.Lifecycle |
static class |
LocalDiskRepositoryManager.Module |
protected class |
LocalDiskRepositoryManager.ProjectVisitor |
Modifier and Type | Method and Description |
---|---|
org.eclipse.jgit.lib.Repository |
createRepository(com.google.gerrit.reviewdb.client.Project.NameKey name)
Create (and open) a repository by name.
|
java.nio.file.Path |
getBasePath(com.google.gerrit.reviewdb.client.Project.NameKey name)
Return the basePath under which the specified project is stored.
|
java.lang.String |
getProjectDescription(com.google.gerrit.reviewdb.client.Project.NameKey name)
Read the
GIT_DIR/description file for gitweb. |
java.util.SortedSet<com.google.gerrit.reviewdb.client.Project.NameKey> |
list() |
org.eclipse.jgit.lib.Repository |
openRepository(com.google.gerrit.reviewdb.client.Project.NameKey name)
Get (or open) a repository by name.
|
protected void |
scanProjects(LocalDiskRepositoryManager.ProjectVisitor visitor) |
void |
setProjectDescription(com.google.gerrit.reviewdb.client.Project.NameKey name,
java.lang.String description)
Set the
GIT_DIR/description file for gitweb. |
void |
start() |
void |
stop() |
public void start()
start
in interface com.google.gerrit.extensions.events.LifecycleListener
public void stop()
stop
in interface com.google.gerrit.extensions.events.LifecycleListener
public java.nio.file.Path getBasePath(com.google.gerrit.reviewdb.client.Project.NameKey name)
name
- the name of the projectpublic org.eclipse.jgit.lib.Repository openRepository(com.google.gerrit.reviewdb.client.Project.NameKey name) throws org.eclipse.jgit.errors.RepositoryNotFoundException
GitRepositoryManager
openRepository
in interface GitRepositoryManager
name
- the repository name, relative to the base directory.close()
when done to decrement the resource handle.org.eclipse.jgit.errors.RepositoryNotFoundException
- the name does not denote an existing
repository.public org.eclipse.jgit.lib.Repository createRepository(com.google.gerrit.reviewdb.client.Project.NameKey name) throws org.eclipse.jgit.errors.RepositoryNotFoundException, RepositoryCaseMismatchException
GitRepositoryManager
createRepository
in interface GitRepositoryManager
name
- the repository name, relative to the base directory.close()
when done to decrement the resource handle.RepositoryCaseMismatchException
- the name collides with an existing
repository name, but only in case of a character within the name.org.eclipse.jgit.errors.RepositoryNotFoundException
- the name is invalid.public java.lang.String getProjectDescription(com.google.gerrit.reviewdb.client.Project.NameKey name) throws org.eclipse.jgit.errors.RepositoryNotFoundException, java.io.IOException
GitRepositoryManager
GIT_DIR/description
file for gitweb.
NB: This code should really be in JGit, as a member of the Repository object. Until it moves there, its here.
getProjectDescription
in interface GitRepositoryManager
name
- the repository name, relative to the base directory.org.eclipse.jgit.errors.RepositoryNotFoundException
- the named repository does not exist.java.io.IOException
- the description file exists, but is not readable by
this process.public void setProjectDescription(com.google.gerrit.reviewdb.client.Project.NameKey name, java.lang.String description)
GitRepositoryManager
GIT_DIR/description
file for gitweb.
NB: This code should really be in JGit, as a member of the Repository object. Until it moves there, its here.
setProjectDescription
in interface GitRepositoryManager
name
- the repository name, relative to the base directory.description
- new description text for the repository.public java.util.SortedSet<com.google.gerrit.reviewdb.client.Project.NameKey> list()
list
in interface GitRepositoryManager
protected void scanProjects(LocalDiskRepositoryManager.ProjectVisitor visitor)