public class PatchFile extends Object
Patch
instance.Constructor and Description |
---|
PatchFile(org.eclipse.jgit.lib.Repository repo,
PatchList patchList,
String fileName) |
Modifier and Type | Method and Description |
---|---|
String |
getLine(int file,
int line)
Extract a line from the file, as a string.
|
int |
getLineCount(int file)
Return number of lines in file.
|
public PatchFile(org.eclipse.jgit.lib.Repository repo, PatchList patchList, String fileName) throws org.eclipse.jgit.errors.MissingObjectException, org.eclipse.jgit.errors.IncorrectObjectTypeException, IOException
org.eclipse.jgit.errors.MissingObjectException
org.eclipse.jgit.errors.IncorrectObjectTypeException
IOException
public String getLine(int file, int line) throws com.google.gerrit.common.errors.CorruptEntityException, IOException, com.google.gerrit.common.errors.NoSuchEntityException
file
- the file index to extract.line
- the line number to extract (1 based; 1 is the first line).com.google.gerrit.common.errors.CorruptEntityException
- the patch cannot be read.IOException
- the patch or complete file content cannot be read.com.google.gerrit.common.errors.NoSuchEntityException
public int getLineCount(int file) throws com.google.gerrit.common.errors.CorruptEntityException, IOException, com.google.gerrit.common.errors.NoSuchEntityException
file
- the file index to extract.com.google.gerrit.common.errors.CorruptEntityException
- the patch cannot be read.IOException
- the patch or complete file content cannot be read.com.google.gerrit.common.errors.NoSuchEntityException
- the file is not exist.