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 ofRepoCommand.RemoteReadercallback.
-
-
Constructor Summary
Constructors Constructor Description DefaultRemoteReader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]readFile(String uri, String ref, String path)Read a file from a remote repository.protected byte[]readFileFromRepo(Repository repo, String ref, String path)Read a file from the repositoryObjectIdsha1(String uri, String ref)Read a remote ref sha1.
-
-
-
Method Detail
-
sha1
public ObjectId sha1(String uri, 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(String uri, String ref, String path) throws GitAPIException, IOException
Description 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:
GitAPIExceptionIOException
-
readFileFromRepo
protected byte[] readFileFromRepo(Repository repo, String ref, String path) throws GitAPIException, 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:
GitAPIExceptionIOException- Since:
- 3.5
-
-