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.RemoteReadercallback.
-
-
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 repositoryObjectIdsha1(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.RemoteReaderRead a remote ref sha1.- Specified by:
sha1in 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.IOExceptionDescription copied from interface:RepoCommand.RemoteReaderRead a file from a remote repository.- Specified by:
readFilein 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:
GitAPIExceptionjava.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:
GitAPIExceptionjava.io.IOException- Since:
- 3.5
-
-