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.
  • Field Details

  • Constructor Details

    • DfsRepository

      protected DfsRepository(DfsRepositoryBuilder builder)
      Initialize a DFS repository.
      Parameters:
      builder - description of the repository.
  • Method Details

    • getObjectDatabase

      public abstract DfsObjDatabase getObjectDatabase()
      Get the object database which stores this repository's data.
      Specified by:
      getObjectDatabase in class Repository
      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 class Repository
      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 class Repository
      Returns:
      the configuration of this repository.
    • getIdentifier

      public String getIdentifier()
      Get repository identifier.
      Specified by:
      getIdentifier in class Repository
      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 class Repository
      Throws:
      IOException
    • notifyIndexChanged

      public void notifyIndexChanged(boolean internal)
      Notify that the index changed by firing an IndexChangedEvent.
      Specified by:
      notifyIndexChanged in class Repository
      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 class Repository
      Parameters:
      refName - a String object.
      Returns:
      a ReflogReader for the supplied refname, or null if the named ref does not exist.
      Throws:
      IOException - the ref could not be accessed.
    • createAttributesNodeProvider

      public AttributesNodeProvider createAttributesNodeProvider()
      Specified by:
      createAttributesNodeProvider in class Repository
      Returns:
      a new AttributesNodeProvider. This AttributesNodeProvider is lazy loaded only once. It means that it will not be updated after loading. Prefer creating new instance for each use.