public class PatchFile
extends java.lang.Object
Patch
instance.Constructor and Description |
---|
PatchFile(org.eclipse.jgit.lib.Repository repo,
PatchList patchList,
java.lang.String fileName) |
Modifier and Type | Method and Description |
---|---|
java.lang.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, java.lang.String fileName) throws org.eclipse.jgit.errors.MissingObjectException, org.eclipse.jgit.errors.IncorrectObjectTypeException, java.io.IOException
org.eclipse.jgit.errors.MissingObjectException
org.eclipse.jgit.errors.IncorrectObjectTypeException
java.io.IOException
public java.lang.String getLine(int file, int line) throws java.io.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).java.io.IOException
- the patch or complete file content cannot be read.com.google.gerrit.common.errors.NoSuchEntityException
public int getLineCount(int file) throws java.io.IOException, com.google.gerrit.common.errors.NoSuchEntityException
file
- the file index to extract.java.io.IOException
- the patch or complete file content cannot be read.com.google.gerrit.common.errors.NoSuchEntityException
- the file is not exist.