- 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 protectedDfsRepository(DfsRepositoryBuilder builder)Initialize a DFS repository.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidcreate(boolean bare)Create a new Git repository initializing the necessary files and directories.AttributesNodeProvidercreateAttributesNodeProvider()Create a newAttributesNodeProvider.booleanexists()Check if the repository already exists.StoredConfiggetConfig()Get the configuration of this repository.DfsRepositoryDescriptiongetDescription()Get the description of this repository.StringgetIdentifier()Get repository identifier.abstract DfsObjDatabasegetObjectDatabase()Get the object database which stores this repository's data.ReflogReadergetReflogReader(String refName)Get the reflog readervoidnotifyIndexChanged(boolean internal)Notify that the index changed by firing an IndexChangedEvent.voidscanForRepoChanges()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:
getObjectDatabasein 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 IOExceptionCheck 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 IOExceptionCreate a new Git repository initializing the necessary files and directories.- Specified by:
createin 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:
getConfigin classRepository- Returns:
- the configuration of this repository.
-
getIdentifier
public String getIdentifier()
Get repository identifier.- Specified by:
getIdentifierin classRepository- Returns:
- repository identifier. The returned identifier has to be unique within a given Git server.
-
scanForRepoChanges
public void scanForRepoChanges() throws IOExceptionForce a scan for changed refs. Fires an IndexChangedEvent(false) if changes are detected.- Specified by:
scanForRepoChangesin classRepository- Throws:
IOException
-
notifyIndexChanged
public void notifyIndexChanged(boolean internal)
Notify that the index changed by firing an IndexChangedEvent.- Specified by:
notifyIndexChangedin classRepository- Parameters:
internal-trueif the index was changed by the same JGit process
-
getReflogReader
public ReflogReader getReflogReader(String refName) throws IOException
Get the reflog reader- Specified by:
getReflogReaderin classRepository- Parameters:
refName- aStringobject.- Returns:
- a
ReflogReaderfor the supplied refname, ornullif the named ref does not exist. - Throws:
IOException- the ref could not be accessed.
-
createAttributesNodeProvider
public AttributesNodeProvider createAttributesNodeProvider()
Create a newAttributesNodeProvider.- Specified by:
createAttributesNodeProviderin classRepository- Returns:
- a new
AttributesNodeProvider. ThisAttributesNodeProvideris lazy loaded only once. It means that it will not be updated after loading. Prefer creating new instance for each use.
-
-