public abstract class BlobUtils extends Object
This class provides helpers for getting the content and the ids of blobs at different paths and commits.
This class also provides helpers for computing the differences between the content of blobs.
| Constructor and Description |
|---|
BlobUtils() |
| Modifier and Type | Method and Description |
|---|---|
static Collection<org.eclipse.jgit.diff.Edit> |
diff(org.eclipse.jgit.lib.ObjectReader reader,
org.eclipse.jgit.lib.ObjectId blob1,
org.eclipse.jgit.lib.ObjectId blob2)
Diff the blobs at the given object ids using the
RawTextComparator.DEFAULT comparator. |
static Collection<org.eclipse.jgit.diff.Edit> |
diff(org.eclipse.jgit.lib.ObjectReader reader,
org.eclipse.jgit.lib.ObjectId blob1,
org.eclipse.jgit.lib.ObjectId blob2,
org.eclipse.jgit.diff.RawTextComparator comparator)
Diff the blobs at the given object ids.
|
static Collection<org.eclipse.jgit.diff.Edit> |
diff(org.eclipse.jgit.lib.Repository repository,
org.eclipse.jgit.lib.ObjectId blob1,
org.eclipse.jgit.lib.ObjectId blob2)
Diff the blobs at the given object ids using the
RawTextComparator.DEFAULT comparator. |
static Collection<org.eclipse.jgit.diff.Edit> |
diff(org.eclipse.jgit.lib.Repository repository,
org.eclipse.jgit.lib.ObjectId blob1,
org.eclipse.jgit.lib.ObjectId blob2,
org.eclipse.jgit.diff.RawTextComparator comparator)
Diff the blobs at the given object ids.
|
protected static byte[] |
getBytes(org.eclipse.jgit.lib.ObjectReader reader,
org.eclipse.jgit.lib.ObjectId id)
Get the contents of the the blob with the given id as a byte array.
|
protected static byte[] |
getBytes(org.eclipse.jgit.lib.Repository repository,
org.eclipse.jgit.lib.ObjectId id)
Get the contents of the the blob with the given id as a byte array.
|
protected static byte[] |
getBytes(org.eclipse.jgit.lib.Repository repository,
org.eclipse.jgit.revwalk.RevCommit commit,
String path)
Get the contents of the the blob in the commit located at the given path
as a byte array.
|
static String |
getContent(org.eclipse.jgit.lib.Repository repository,
org.eclipse.jgit.lib.ObjectId id)
Get the contents of the the blob with the given id as a UTF-8
String. |
static String |
getContent(org.eclipse.jgit.lib.Repository repository,
org.eclipse.jgit.lib.ObjectId commitId,
String path)
Get the contents of the blob in the commit located at the given path.
|
static String |
getContent(org.eclipse.jgit.lib.Repository repository,
String revision,
String path)
Get the contents of the blob at the given path in the commit that the
revision references.
|
static String |
getHeadContent(org.eclipse.jgit.lib.Repository repository,
String path)
Get the contents of the blob at the given path in the commit that HEAD
references.
|
static org.eclipse.jgit.lib.ObjectId |
getHeadId(org.eclipse.jgit.lib.Repository repository,
String path)
Get the id of the blob at the path in the commit that HEAD currently
references.
|
static org.eclipse.jgit.lib.ObjectStream |
getHeadStream(org.eclipse.jgit.lib.Repository repository,
String path)
Open a stream to the contents of the blob at the path in the commit that
HEAD currently references.
|
static org.eclipse.jgit.lib.ObjectId |
getId(org.eclipse.jgit.lib.Repository repository,
org.eclipse.jgit.lib.ObjectId commitId,
String path)
Get the id of the blob at the path in the commit that the given revision
references.
|
static org.eclipse.jgit.lib.ObjectId |
getId(org.eclipse.jgit.lib.Repository repository,
String revision,
String path)
Get the id of the blob at the path in the commit that the given revision
references.
|
static byte[] |
getRawContent(org.eclipse.jgit.lib.Repository repository,
org.eclipse.jgit.lib.ObjectId commitId,
String path)
Get the raw contents of the blob in the commit located at the given path.
|
static byte[] |
getRawContent(org.eclipse.jgit.lib.Repository repository,
String revision,
String path)
Get raw contents of the blob at the given path in the commit that the
revision references.
|
static byte[] |
getRawHeadContent(org.eclipse.jgit.lib.Repository repository,
String path)
Get the raw contents of the blob at the given path in the commit that
HEAD references.
|
static org.eclipse.jgit.lib.ObjectStream |
getStream(org.eclipse.jgit.lib.Repository repository,
org.eclipse.jgit.lib.ObjectId commitId,
String path)
Open a stream to the contents of the blob at the path in the given commit
|
static org.eclipse.jgit.lib.ObjectStream |
getStream(org.eclipse.jgit.lib.Repository repository,
String revision,
String path)
Open a stream to the contents of the blob at the path in the commit that
the given revision references.
|
protected static org.eclipse.jgit.lib.ObjectId |
lookupId(org.eclipse.jgit.lib.Repository repository,
org.eclipse.jgit.revwalk.RevCommit commit,
String path)
Get the id of the blob at the path in the given commit.
|
protected static String |
toString(org.eclipse.jgit.lib.Repository repository,
byte[] raw)
Convert byte array to UTF-8
String |
protected static byte[] getBytes(org.eclipse.jgit.lib.Repository repository,
org.eclipse.jgit.lib.ObjectId id)
repository - id - protected static byte[] getBytes(org.eclipse.jgit.lib.ObjectReader reader,
org.eclipse.jgit.lib.ObjectId id)
reader - id - protected static String toString(org.eclipse.jgit.lib.Repository repository, byte[] raw)
Stringrepository - raw - public static String getContent(org.eclipse.jgit.lib.Repository repository, org.eclipse.jgit.lib.ObjectId id)
String.repository - id - protected static org.eclipse.jgit.lib.ObjectId lookupId(org.eclipse.jgit.lib.Repository repository,
org.eclipse.jgit.revwalk.RevCommit commit,
String path)
repository - commit - path - protected static byte[] getBytes(org.eclipse.jgit.lib.Repository repository,
org.eclipse.jgit.revwalk.RevCommit commit,
String path)
repository - commit - path - public static byte[] getRawContent(org.eclipse.jgit.lib.Repository repository,
String revision,
String path)
repository - revision - path - public static byte[] getRawContent(org.eclipse.jgit.lib.Repository repository,
org.eclipse.jgit.lib.ObjectId commitId,
String path)
repository - commitId - path - public static String getContent(org.eclipse.jgit.lib.Repository repository, org.eclipse.jgit.lib.ObjectId commitId, String path)
repository - commitId - path - public static String getContent(org.eclipse.jgit.lib.Repository repository, String revision, String path)
repository - revision - path - public static String getHeadContent(org.eclipse.jgit.lib.Repository repository, String path)
repository - path - public static byte[] getRawHeadContent(org.eclipse.jgit.lib.Repository repository,
String path)
repository - path - public static org.eclipse.jgit.lib.ObjectId getId(org.eclipse.jgit.lib.Repository repository,
String revision,
String path)
repository - revision - path - public static org.eclipse.jgit.lib.ObjectId getHeadId(org.eclipse.jgit.lib.Repository repository,
String path)
repository - path - public static org.eclipse.jgit.lib.ObjectId getId(org.eclipse.jgit.lib.Repository repository,
org.eclipse.jgit.lib.ObjectId commitId,
String path)
repository - commitId - path - public static org.eclipse.jgit.lib.ObjectStream getStream(org.eclipse.jgit.lib.Repository repository,
org.eclipse.jgit.lib.ObjectId commitId,
String path)
repository - commitId - path - public static org.eclipse.jgit.lib.ObjectStream getHeadStream(org.eclipse.jgit.lib.Repository repository,
String path)
repository - path - public static org.eclipse.jgit.lib.ObjectStream getStream(org.eclipse.jgit.lib.Repository repository,
String revision,
String path)
repository - revision - path - public static Collection<org.eclipse.jgit.diff.Edit> diff(org.eclipse.jgit.lib.Repository repository, org.eclipse.jgit.lib.ObjectId blob1, org.eclipse.jgit.lib.ObjectId blob2)
RawTextComparator.DEFAULT comparator.repository - blob1 - blob2 - diff(Repository, ObjectId, ObjectId, RawTextComparator)public static Collection<org.eclipse.jgit.diff.Edit> diff(org.eclipse.jgit.lib.Repository repository, org.eclipse.jgit.lib.ObjectId blob1, org.eclipse.jgit.lib.ObjectId blob2, org.eclipse.jgit.diff.RawTextComparator comparator)
This method will return an empty list if the content of either blob is binary.
repository - blob1 - blob2 - comparator - public static Collection<org.eclipse.jgit.diff.Edit> diff(org.eclipse.jgit.lib.ObjectReader reader, org.eclipse.jgit.lib.ObjectId blob1, org.eclipse.jgit.lib.ObjectId blob2)
RawTextComparator.DEFAULT comparator.reader - blob1 - blob2 - diff(ObjectReader, ObjectId, ObjectId, RawTextComparator)public static Collection<org.eclipse.jgit.diff.Edit> diff(org.eclipse.jgit.lib.ObjectReader reader, org.eclipse.jgit.lib.ObjectId blob1, org.eclipse.jgit.lib.ObjectId blob2, org.eclipse.jgit.diff.RawTextComparator comparator)
This method will return an empty list if the content of either blob is binary.
reader - blob1 - blob2 - comparator - Copyright © 2011-2017. All Rights Reserved.