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 |
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
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