Class RepoCommand.DefaultRemoteReader

java.lang.Object
org.eclipse.jgit.gitrepo.RepoCommand.DefaultRemoteReader
All Implemented Interfaces:
RepoCommand.RemoteReader
Enclosing class:
RepoCommand

public static class RepoCommand.DefaultRemoteReader extends Object implements RepoCommand.RemoteReader
A default implementation of RepoCommand.RemoteReader callback.
  • Constructor Details

    • DefaultRemoteReader

      public DefaultRemoteReader()
  • Method Details

    • sha1

      public ObjectId sha1(String uri, String ref) throws GitAPIException
      Description copied from interface: RepoCommand.RemoteReader
      Read a remote ref sha1.
      Specified by:
      sha1 in interface RepoCommand.RemoteReader
      Parameters:
      uri - The URI of the remote repository
      ref - Name of the ref to lookup. May be a short-hand form, e.g. "master" which is automatically expanded to "refs/heads/master" if "refs/heads/master" already exists.
      Returns:
      the sha1 of the remote repository, or null if the ref does not exist.
      Throws:
      GitAPIException
    • readFileWithMode

      public RepoCommand.RemoteFile readFileWithMode(String uri, String ref, String path) throws GitAPIException, IOException
      Description copied from interface: RepoCommand.RemoteReader
      Read contents and mode (i.e. permissions) of the file from a remote repository.
      Specified by:
      readFileWithMode in interface RepoCommand.RemoteReader
      Parameters:
      uri - The URI of the remote repository
      ref - Name of the ref to lookup. May be a short-hand form, e.g. "master" which is automatically expanded to "refs/heads/master" if "refs/heads/master" already exists.
      path - The relative path (inside the repo) to the file to read
      Returns:
      The contents and file mode of the file in the given repository and branch. Never null.
      Throws:
      GitAPIException - If the ref have an invalid or ambiguous name, or it does not exist in the repository,
      IOException - If the object does not exist or is too large