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
`DefaultRemoteReader()`

### Method Summary

All Methods Instance Methods Concrete Methods
`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 repository
`ObjectId` `sha1​(String uri, String ref)` Read a remote ref sha1.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### DefaultRemoteReader

    public DefaultRemoteReader()

### Method Detail

#### 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` - 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.RemoteReader`
Read a file from a remote repository.

Specified by:
  `readFile` in interface `RepoCommand.RemoteReader`
Parameters:
  `uri` - The URI of the remote repository
  `ref` - The ref (branch/tag/etc.) to read
  `path` - The relative path (inside the repo) to the file to read
Returns:
  the file content.
Throws:
  `GitAPIException`
  `IOException`

#### 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 file
  `ref` - The ref (branch/tag/etc.) to read
  `path` - The relative path (inside the repo) to the file to read
Returns:
  the file's content
Throws:
  `GitAPIException`
  `IOException`
Since:
  3.5