Package org.eclipse.jgit.gitrepo
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionreadFileWithMode
(String uri, String ref, String path) Read contents and mode (i.e.Read a remote ref sha1.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.jgit.gitrepo.RepoCommand.RemoteReader
readFile
-
Constructor Details
-
DefaultRemoteReader
public DefaultRemoteReader()
-
-
Method Details
-
sha1
Description copied from interface:RepoCommand.RemoteReader
Read a remote ref sha1.- Specified by:
sha1
in interfaceRepoCommand.RemoteReader
- Parameters:
uri
- The URI of the remote repositoryref
- 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 interfaceRepoCommand.RemoteReader
- Parameters:
uri
- The URI of the remote repositoryref
- 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
-