public class LocalDiskRepositoryManager extends java.lang.Object implements GitRepositoryManager
| Modifier and Type | Class and Description |
|---|---|
static class |
LocalDiskRepositoryManager.Lifecycle |
static class |
LocalDiskRepositoryManager.Module |
| 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.io.File |
getBasePath() |
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 |
openMetadataRepository(com.google.gerrit.reviewdb.client.Project.NameKey name)
Open the repository storing metadata for the given project.
|
org.eclipse.jgit.lib.Repository |
openRepository(com.google.gerrit.reviewdb.client.Project.NameKey name)
Get (or open) a repository by name.
|
void |
setProjectDescription(com.google.gerrit.reviewdb.client.Project.NameKey name,
java.lang.String description)
Set the
GIT_DIR/description file for gitweb. |
public java.io.File getBasePath()
public org.eclipse.jgit.lib.Repository openRepository(com.google.gerrit.reviewdb.client.Project.NameKey name)
throws org.eclipse.jgit.errors.RepositoryNotFoundException
GitRepositoryManageropenRepository in interface GitRepositoryManagername - 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
GitRepositoryManagerIf the implementation supports separate metadata repositories, this method must also create the metadata repository, but does not open it.
createRepository in interface GitRepositoryManagername - 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 org.eclipse.jgit.lib.Repository openMetadataRepository(com.google.gerrit.reviewdb.client.Project.NameKey name)
throws org.eclipse.jgit.errors.RepositoryNotFoundException,
java.io.IOException
GitRepositoryManager
This includes any project-specific metadata except what is stored
in refs/meta/config. Implementations may choose to store all
metadata in the original project.
openMetadataRepository in interface GitRepositoryManagername - the base project name name.close() when done to decrement the resource handle.org.eclipse.jgit.errors.RepositoryNotFoundException - the name does not denote an existing
repository.java.io.IOException - the name cannot be read as a repository.public java.lang.String getProjectDescription(com.google.gerrit.reviewdb.client.Project.NameKey name)
throws org.eclipse.jgit.errors.RepositoryNotFoundException,
java.io.IOException
GitRepositoryManagerGIT_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 GitRepositoryManagername - 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)
GitRepositoryManagerGIT_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 GitRepositoryManagername - 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