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 java.lang.Object implements RepoCommand.RemoteReader
A default implementation ofRepoCommand.RemoteReader
callback.
-
-
Constructor Summary
Constructors Constructor Description DefaultRemoteReader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
readFile(java.lang.String uri, java.lang.String ref, java.lang.String path)
Read a file from a remote repository.protected byte[]
readFileFromRepo(Repository repo, java.lang.String ref, java.lang.String path)
Read a file from the repositoryObjectId
sha1(java.lang.String uri, java.lang.String ref)
Read a remote ref sha1.
-
-
-
Method Detail
-
sha1
public ObjectId sha1(java.lang.String uri, java.lang.String ref) throws GitAPIException
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
- The ref (branch/tag/etc.) to read- Returns:
- the sha1 of the remote repository
- Throws:
GitAPIException
-
readFile
public byte[] readFile(java.lang.String uri, java.lang.String ref, java.lang.String path) throws GitAPIException, java.io.IOException
Description copied from interface:RepoCommand.RemoteReader
Read a file from a remote repository.- Specified by:
readFile
in interfaceRepoCommand.RemoteReader
- Parameters:
uri
- The URI of the remote repositoryref
- The ref (branch/tag/etc.) to readpath
- The relative path (inside the repo) to the file to read- Returns:
- the file content.
- Throws:
GitAPIException
java.io.IOException
-
readFileFromRepo
protected byte[] readFileFromRepo(Repository repo, java.lang.String ref, java.lang.String path) throws GitAPIException, java.io.IOException
Read a file from the repository- Parameters:
repo
- The repository containing the fileref
- The ref (branch/tag/etc.) to readpath
- The relative path (inside the repo) to the file to read- Returns:
- the file's content
- Throws:
GitAPIException
java.io.IOException
- Since:
- 3.5
-
-