1
2
3
4
5
6
7
8
9
10
11
12
13 package org.eclipse.jgit.revwalk;
14
15 import java.io.IOException;
16
17 import org.eclipse.jgit.errors.IncorrectObjectTypeException;
18 import org.eclipse.jgit.errors.MissingObjectException;
19 import org.eclipse.jgit.lib.AnyObjectId;
20 import org.eclipse.jgit.lib.Constants;
21
22
23
24
25 public class RevBlob extends RevObject {
26
27
28
29
30
31
32 protected RevBlob(AnyObjectId id) {
33 super(id);
34 }
35
36
37 @Override
38 public final int getType() {
39 return Constants.OBJ_BLOB;
40 }
41
42 @Override
43 void parseHeaders(RevWalk walk) throws MissingObjectException,
44 IncorrectObjectTypeException, IOException {
45 if (walk.reader.has(this))
46 flags |= PARSED;
47 else
48 throw new MissingObjectException(this, getType());
49 }
50
51 @Override
52 void parseBody(RevWalk walk) throws MissingObjectException,
53 IncorrectObjectTypeException, IOException {
54 if ((flags & PARSED) == 0)
55 parseHeaders(walk);
56 }
57 }