org.eclipse.jgit.patch.FileHeader s from a
unified diff patch file
| Modifier and Type | Field and Description |
|---|---|
| private static final byte[][] | |
| private static final byte[] | |
| private static final byte[] | |
| private static final byte[] | |
| pack-priv static final byte[] | |
| private final List | errors
Formatting errors, if any were identified. |
| private final List | files
The files, in the order they were parsed out of the input. |
| private static final byte[] | |
| pack-priv static final byte[] |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| pack-priv void | |
| public List | |
| public List | Returns: list of files described in the patch, in occurrence order.Get list of files described in the patch, in occurrence order. |
| private static boolean | |
| public void | parse(InputStream
the stream to read the patch data from. The stream is read
until EOF is reached. is)Parse a patch received from an InputStream. |
| public void | parse(byte[]
the buffer to parse. buf, int starting position to parse from. ptr, int 1 past the last position to end parsing. The total length to
be parsed is end)end - ptr.Parse a patch stored in a byte[]. |
| private int | |
| private int | |
| private int | |
| private int | |
| private int | |
| private int | |
| private static byte[] | |
| private static int | |
| pack-priv void |
| BIN_HEADERS | back to summary |
|---|---|
| private static final byte[][] BIN_HEADERS | |
| BIN_TRAILER | back to summary |
|---|---|
| private static final byte[] BIN_TRAILER | |
| DIFF_CC | back to summary |
|---|---|
| private static final byte[] DIFF_CC | |
| DIFF_COMBINED | back to summary |
|---|---|
| private static final byte[] DIFF_COMBINED | |
| DIFF_GIT | back to summary |
|---|---|
| pack-priv static final byte[] DIFF_GIT | |
| errors | back to summary |
|---|---|
| private final List<FormatError> errors Formatting errors, if any were identified. | |
| files | back to summary |
|---|---|
| private final List<FileHeader> files The files, in the order they were parsed out of the input. | |
| GIT_BINARY | back to summary |
|---|---|
| private static final byte[] GIT_BINARY | |
| SIG_FOOTER | back to summary |
|---|---|
| pack-priv static final byte[] SIG_FOOTER | |
| Patch | back to summary |
|---|---|
| public Patch() Create an empty patch. | |
| addError | back to summary |
|---|---|
| public void addError(FormatError err) Add a formatting error to this patch script.
| |
| addFile | back to summary |
|---|---|
| public void addFile(FileHeader fh) Add a single file to this patch. Typically files should be added by parsing the text through one of this class's parse methods.
| |
| error | back to summary |
|---|---|
| pack-priv void error(byte[] buf, int ptr, String msg) | |
| getErrors | back to summary |
|---|---|
| public List Get collection of formatting errors.
| |
| getFiles | back to summary |
|---|---|
| public List Get list of files described in the patch, in occurrence order.
| |
| matchAny | back to summary |
|---|---|
| private static boolean matchAny(final byte[] buf, final int c, final byte[][] srcs) | |
| parse | back to summary |
|---|---|
| public void parse(InputStream is) throws IOException Parse a patch received from an InputStream. Multiple parse calls on the same instance will concatenate the patch data, but each parse input must start with a valid file header (don't split a single file across parse calls).
| |
| parse | back to summary |
|---|---|
| public void parse(byte[] buf, int ptr, int end) Parse a patch stored in a byte[]. Multiple parse calls on the same instance will concatenate the patch data, but each parse input must start with a valid file header (don't split a single file across parse calls).
| |
| parseDiffCombined | back to summary |
|---|---|
| private int parseDiffCombined(final byte[] hdr, final byte[] buf, final int start, final int end) | |
| parseDiffGit | back to summary |
|---|---|
| private int parseDiffGit(byte[] buf, int start, int end) | |
| parseFile | back to summary |
|---|---|
| private int parseFile(byte[] buf, int c, int end) | |
| parseGitBinary | back to summary |
|---|---|
| private int parseGitBinary(FileHeader fh, int c, int end) | |
| parseHunks | back to summary |
|---|---|
| private int parseHunks(FileHeader fh, int c, int end) | |
| parseTraditionalPatch | back to summary |
|---|---|
| private int parseTraditionalPatch(final byte[] buf, final int start, final int end) | |
| readFully | back to summary |
|---|---|
| private static byte[] readFully(InputStream is) throws IOException | |
| skipFile | back to summary |
|---|---|
| private static int skipFile(byte[] buf, int ptr) | |
| warn | back to summary |
|---|---|
| pack-priv void warn(byte[] buf, int ptr, String msg) | |