|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.eclipse.jgit.lib.TreeEntry
org.eclipse.jgit.lib.Tree
public class Tree
A representation of a Git tree entry. A Tree is a directory in Git.
| Field Summary |
|---|
| Fields inherited from class org.eclipse.jgit.lib.TreeEntry |
|---|
CONCURRENT_MODIFICATION, LOADED_ONLY, MODIFIED_ONLY |
| Constructor Summary | |
|---|---|
Tree(Repository repo)
Constructor for a new Tree |
|
Tree(Repository repo,
ObjectId myId,
byte[] raw)
Construct a Tree object with known content and hash value |
|
Tree(Tree parent,
byte[] nameUTF8)
Construct a new Tree under another Tree |
|
Tree(Tree parent,
ObjectId id,
byte[] nameUTF8)
Construct a Tree with a known SHA-1 under another tree. |
|
| Method Summary | |
|---|---|
void |
accept(TreeVisitor tv,
int flags)
Visit the members of this TreeEntry. |
void |
addEntry(TreeEntry e)
Add the specified tree entry to this tree. |
FileTreeEntry |
addFile(byte[] s,
int offset)
Adds a new or existing file with the specified name to this tree. |
FileTreeEntry |
addFile(java.lang.String name)
Adds a new or existing file with the specified name to this tree. |
Tree |
addTree(byte[] s,
int offset)
Adds a new or existing Tree with the specified name to this tree. |
Tree |
addTree(java.lang.String name)
Adds a new or existing Tree with the specified name to this tree. |
static int |
compareNames(byte[] a,
byte[] b,
int lasta,
int lastb)
Compare two names represented as bytes. |
boolean |
existsBlob(java.lang.String path)
|
boolean |
existsTree(java.lang.String path)
|
TreeEntry |
findBlobMember(java.lang.String s)
|
TreeEntry |
findTreeMember(java.lang.String s)
|
FileMode |
getMode()
|
Repository |
getRepository()
|
Tree |
getTree()
|
ObjectId |
getTreeId()
|
boolean |
isLoaded()
|
boolean |
isRoot()
|
int |
memberCount()
|
TreeEntry[] |
members()
Return all members of the tree sorted in Git order. |
java.lang.String |
toString()
|
void |
unload()
Forget the in-memory data for this tree. |
| Methods inherited from class org.eclipse.jgit.lib.TreeEntry |
|---|
accept, compareTo, delete, detachParent, getFullName, getFullNameUTF8, getId, getName, getNameUTF8, getParent, isModified, lastChar, lastChar, rename, rename, setId, setModified |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Tree(Repository repo)
repo - The repository that owns the Tree.
public Tree(Repository repo,
ObjectId myId,
byte[] raw)
throws java.io.IOException
repo - myId - raw -
java.io.IOException
public Tree(Tree parent,
byte[] nameUTF8)
parent - nameUTF8 -
public Tree(Tree parent,
ObjectId id,
byte[] nameUTF8)
parent - id - nameUTF8 - | Method Detail |
|---|
public static final int compareNames(byte[] a,
byte[] b,
int lasta,
int lastb)
a - nameb - namelasta - '/' if a is a tree, else NULlastb - '/' if b is a tree, else NUL
public FileMode getMode()
getMode in class TreeEntrypublic boolean isRoot()
public Repository getRepository()
getRepository in class TreeEntrypublic final ObjectId getTreeId()
getTreeId in interface Treeishpublic final Tree getTree()
getTree in interface Treeishpublic boolean isLoaded()
public void unload()
public FileTreeEntry addFile(java.lang.String name)
throws java.io.IOException
name - Name
FileTreeEntry for the added file.
java.io.IOException
public FileTreeEntry addFile(byte[] s,
int offset)
throws java.io.IOException
s - an array containing the nameoffset - when the name starts in the tree.
FileTreeEntry for the added file.
java.io.IOException
public Tree addTree(java.lang.String name)
throws java.io.IOException
name - Name
FileTreeEntry for the added tree.
java.io.IOException
public Tree addTree(byte[] s,
int offset)
throws java.io.IOException
s - an array containing the nameoffset - when the name starts in the tree.
FileTreeEntry for the added tree.
java.io.IOException
public void addEntry(TreeEntry e)
throws java.io.IOException
e -
java.io.IOException
public int memberCount()
throws java.io.IOException
java.io.IOException
public TreeEntry[] members()
throws java.io.IOException
100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 a.b 040000 tree 4277b6e69d25e5efa77c455340557b384a4c018a a 100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 a:b
java.io.IOException
public boolean existsTree(java.lang.String path)
throws java.io.IOException
path - to the tree.
java.io.IOException
public boolean existsBlob(java.lang.String path)
throws java.io.IOException
path - of the non-tree entry.
java.io.IOException
public TreeEntry findBlobMember(java.lang.String s)
throws java.io.IOException
s - blob name
TreeEntry representing an object with the specified
relative path.
java.io.IOException
public TreeEntry findTreeMember(java.lang.String s)
throws java.io.IOException
s - Tree Name
java.io.IOException
public void accept(TreeVisitor tv,
int flags)
throws java.io.IOException
TreeEntry
accept in class TreeEntrytv - A visitor object doing the workflags - Specification for what members to visit. See
TreeEntry.MODIFIED_ONLY, TreeEntry.LOADED_ONLY,
TreeEntry.CONCURRENT_MODIFICATION.
java.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||