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
A Git repository on a DFS.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
DfsRepository
(DfsRepositoryBuilder builder) Initialize a DFS repository. -
Method Summary
Modifier and TypeMethodDescriptionvoid
create
(boolean bare) Create a new Git repository initializing the necessary files and directories.Create a newAttributesNodeProvider
.boolean
exists()
Check if the repository already exists.Get the configuration of this repository.Get the description of this repository.Get repository identifier.abstract DfsObjDatabase
Get the object database which stores this repository's data.getReflogReader
(String refName) Get the reflog readervoid
notifyIndexChanged
(boolean internal) Notify that the index changed by firing an IndexChangedEvent.void
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
-
Field Details
-
config
-
description
-
-
Constructor Details
-
DfsRepository
Initialize a DFS repository.- Parameters:
builder
- description of the repository.
-
-
Method Details
-
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
Get the description of this repository.- Returns:
- the description of this repository.
-
exists
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
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
Get the configuration of this repository.- Specified by:
getConfig
in classRepository
- Returns:
- the configuration of this repository.
-
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
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
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
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.
-