本文整理匯總了Java中org.eclipse.jgit.lib.Constants.OBJ_BLOB屬性的典型用法代碼示例。如果您正苦於以下問題:Java Constants.OBJ_BLOB屬性的具體用法?Java Constants.OBJ_BLOB怎麽用?Java Constants.OBJ_BLOB使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.eclipse.jgit.lib.Constants
的用法示例。
在下文中一共展示了Constants.OBJ_BLOB屬性的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getType
private GitObjectType getType (RevObject object) {
GitObjectType objType = GitObjectType.UNKNOWN;
if (object != null) {
switch (object.getType()) {
case Constants.OBJ_COMMIT:
objType = GitObjectType.COMMIT;
break;
case Constants.OBJ_BLOB:
objType = GitObjectType.BLOB;
break;
case Constants.OBJ_TAG:
objType = GitObjectType.TAG;
break;
case Constants.OBJ_TREE:
objType = GitObjectType.TREE;
break;
}
}
return objType;
}
示例2: lookupAny
/**
* Locate a reference to any object without loading it.
* <p>
* The object may or may not exist in the repository. It is impossible to
* tell from this method's return value.
*
* @param id
* name of the object.
* @param type
* type of the object. Must be a valid Git object type.
* @return reference to the object. Never null.
*/
public RevObject lookupAny(final AnyObjectId id, final int type) {
RevObject r = objects.get(id);
if (r == null) {
switch (type) {
case Constants.OBJ_COMMIT:
r = createCommit(id);
break;
case Constants.OBJ_TREE:
r = new RevTree(id);
break;
case Constants.OBJ_BLOB:
r = new RevBlob(id);
break;
case Constants.OBJ_TAG:
r = new RevTag(id);
break;
default:
throw new IllegalArgumentException(MessageFormat.format(
JGitText.get().invalidGitType, Integer.valueOf(type)));
}
objects.add(r);
}
return r;
}
示例3: parseNew
private RevObject parseNew(AnyObjectId id, ObjectLoader ldr)
throws LargeObjectException, CorruptObjectException,
MissingObjectException, IOException {
RevObject r;
int type = ldr.getType();
switch (type) {
case Constants.OBJ_COMMIT: {
final RevCommit c = createCommit(id);
c.parseCanonical(this, getCachedBytes(c, ldr));
r = c;
break;
}
case Constants.OBJ_TREE: {
r = new RevTree(id);
r.flags |= PARSED;
break;
}
case Constants.OBJ_BLOB: {
r = new RevBlob(id);
r.flags |= PARSED;
break;
}
case Constants.OBJ_TAG: {
final RevTag t = new RevTag(id);
t.parseCanonical(this, getCachedBytes(t, ldr));
r = t;
break;
}
default:
throw new IllegalArgumentException(MessageFormat.format(
JGitText.get().badObjectType, Integer.valueOf(type)));
}
objects.add(r);
return r;
}
示例4: getType
@Override
public final int getType() {
return Constants.OBJ_BLOB;
}