Class DfsRepository

  • All Implemented Interfaces:
    java.lang.AutoCloseable
    Direct Known Subclasses:
    InMemoryRepository

    public abstract class DfsRepository
    extends Repository
    A Git repository on a DFS.
    • 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 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 java.io.IOException
        Check if the repository already exists.
        Returns:
        true if the repository exists; false if it is new.
        Throws:
        java.io.IOException - the repository cannot be checked.
      • create

        public void create​(boolean bare)
                    throws java.io.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:
        java.io.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 java.lang.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 java.io.IOException
        Force a scan for changed refs. Fires an IndexChangedEvent(false) if changes are detected.
        Specified by:
        scanForRepoChanges in class Repository
        Throws:
        java.io.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​(java.lang.String refName)
                                     throws java.io.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:
        java.io.IOException - the ref could not be accessed.