Class DfsRepository
- java.lang.Object
-
- org.eclipse.jgit.lib.Repository
-
- org.eclipse.jgit.internal.storage.dfs.DfsRepository
-
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
InMemoryRepository
public abstract class DfsRepository extends Repository
A Git repository on a DFS.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
DfsRepository(DfsRepositoryBuilder builder)
Initialize a DFS repository.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
create(boolean bare)
Create a new Git repository initializing the necessary files and directories.AttributesNodeProvider
createAttributesNodeProvider()
Create a newAttributesNodeProvider
.boolean
exists()
Check if the repository already exists.StoredConfig
getConfig()
Get the configuration of this repository.DfsRepositoryDescription
getDescription()
Get the description of this repository.String
getIdentifier()
Get repository identifier.abstract DfsObjDatabase
getObjectDatabase()
Get the object database which stores this repository's data.ReflogReader
getReflogReader(String refName)
Get the reflog readervoid
notifyIndexChanged(boolean internal)
Notify that the index changed by firing an IndexChangedEvent.void
scanForRepoChanges()
Force a scan for changed refs.-
Methods inherited from class org.eclipse.jgit.lib.Repository
autoGC, close, create, doClose, exactRef, findRef, fireEvent, getAdditionalHaves, getAllRefs, getAllRefsByPeeledObjectId, getBranch, getDirectory, getFS, getFullBranch, getGitwebDescription, getGlobalListenerList, getIndexFile, getInitialBranch, getListenerList, getRefDatabase, getRemoteName, getRemoteNames, getRepositoryState, getTags, getWorkTree, hasObject, incrementOpen, isBare, isValidRefName, lockDirCache, newObjectInserter, newObjectReader, normalizeBranchName, open, open, parseCommit, peel, readCherryPickHead, readCommitEditMsg, readDirCache, readMergeCommitMsg, readMergeHeads, readOrigHead, readRebaseTodo, readRevertHead, readSquashCommitMsg, renameRef, resolve, setGitwebDescription, shortenRefName, shortenRemoteBranchName, simplify, stripWorkDir, toString, updateRef, updateRef, writeCherryPickHead, writeCommitEditMsg, writeMergeCommitMsg, writeMergeHeads, writeOrigHead, writeRebaseTodoFile, writeRevertHead, writeSquashCommitMsg
-
-
-
-
Constructor Detail
-
DfsRepository
protected DfsRepository(DfsRepositoryBuilder builder)
Initialize a DFS repository.- Parameters:
builder
- description of the repository.
-
-
Method Detail
-
getObjectDatabase
public abstract DfsObjDatabase getObjectDatabase()
Get the object database which stores this repository's data.- Specified by:
getObjectDatabase
in classRepository
- Returns:
- the object database which stores this repository's data.
-
getDescription
public DfsRepositoryDescription getDescription()
Get the description of this repository.- Returns:
- the description of this repository.
-
exists
public boolean exists() throws IOException
Check if the repository already exists.- Returns:
- true if the repository exists; false if it is new.
- Throws:
IOException
- the repository cannot be checked.
-
create
public void create(boolean bare) throws IOException
Create a new Git repository initializing the necessary files and directories.- Specified by:
create
in classRepository
- Parameters:
bare
- if true, a bare repository (a repository without a working directory) is created.- Throws:
IOException
- in case of IO problem
-
getConfig
public StoredConfig getConfig()
Get the configuration of this repository.- Specified by:
getConfig
in classRepository
- Returns:
- the configuration of this repository.
-
getIdentifier
public String getIdentifier()
Get repository identifier.- Specified by:
getIdentifier
in classRepository
- Returns:
- repository identifier. The returned identifier has to be unique within a given Git server.
-
scanForRepoChanges
public void scanForRepoChanges() throws IOException
Force a scan for changed refs. Fires an IndexChangedEvent(false) if changes are detected.- Specified by:
scanForRepoChanges
in classRepository
- Throws:
IOException
-
notifyIndexChanged
public void notifyIndexChanged(boolean internal)
Notify that the index changed by firing an IndexChangedEvent.- Specified by:
notifyIndexChanged
in classRepository
- Parameters:
internal
-true
if the index was changed by the same JGit process
-
getReflogReader
public ReflogReader getReflogReader(String refName) throws IOException
Get the reflog reader- Specified by:
getReflogReader
in classRepository
- Parameters:
refName
- aString
object.- Returns:
- a
ReflogReader
for the supplied refname, ornull
if the named ref does not exist. - Throws:
IOException
- the ref could not be accessed.
-
createAttributesNodeProvider
public AttributesNodeProvider createAttributesNodeProvider()
Create a newAttributesNodeProvider
.- Specified by:
createAttributesNodeProvider
in classRepository
- Returns:
- a new
AttributesNodeProvider
. ThisAttributesNodeProvider
is lazy loaded only once. It means that it will not be updated after loading. Prefer creating new instance for each use.
-
-