TreeWalk.forPath(Repository, String, org.eclipse.jgit.revwalk.RevTree)
.
To lookup information about multiple paths at once, use a
TreeWalk
and obtain the current entry's
information from its getter methods.@Deprecated public class Tree extends TreeEntry
Constructor and Description |
---|
Tree(Repository repo)
Deprecated.
Constructor for a new Tree
|
Tree(Repository repo,
ObjectId myId,
byte[] raw)
Deprecated.
Construct a Tree object with known content and hash value
|
Tree(Tree parent,
byte[] nameUTF8)
Deprecated.
Construct a new Tree under another Tree
|
Tree(Tree parent,
ObjectId id,
byte[] nameUTF8)
Deprecated.
Construct a Tree with a known SHA-1 under another tree.
|
Modifier and Type | Method and Description |
---|---|
void |
addEntry(TreeEntry e)
Deprecated.
Add the specified tree entry to this tree.
|
FileTreeEntry |
addFile(byte[] s,
int offset)
Deprecated.
Adds a new or existing file with the specified name to this tree.
|
FileTreeEntry |
addFile(String name)
Deprecated.
Adds a new or existing file with the specified name to this tree.
|
Tree |
addTree(byte[] s,
int offset)
Deprecated.
Adds a new or existing Tree with the specified name to this tree.
|
Tree |
addTree(String name)
Deprecated.
Adds a new or existing Tree with the specified name to this tree.
|
static int |
compareNames(byte[] a,
byte[] b,
int lasta,
int lastb)
Deprecated.
Compare two names represented as bytes.
|
boolean |
existsBlob(String path)
Deprecated.
|
boolean |
existsTree(String path)
Deprecated.
|
TreeEntry |
findBlobMember(String s)
Deprecated.
|
TreeEntry |
findTreeMember(String s)
Deprecated.
|
byte[] |
format()
Deprecated.
Format this Tree in canonical format.
|
FileMode |
getMode()
Deprecated.
|
Repository |
getRepository()
Deprecated.
|
boolean |
isLoaded()
Deprecated.
|
boolean |
isRoot()
Deprecated.
|
int |
memberCount()
Deprecated.
|
TreeEntry[] |
members()
Deprecated.
Return all members of the tree sorted in Git order.
|
String |
toString()
Deprecated.
|
void |
unload()
Deprecated.
Forget the in-memory data for this tree.
|
compareTo, delete, detachParent, getFullName, getFullNameUTF8, getId, getName, getNameUTF8, getParent, isModified, lastChar, rename, rename, setId, setModified
public Tree(Repository repo)
repo
- The repository that owns the Tree.public Tree(Repository repo, ObjectId myId, byte[] raw) throws IOException
repo
- myId
- raw
- IOException
public Tree(Tree parent, byte[] nameUTF8)
parent
- nameUTF8
- 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 NULpublic FileMode getMode()
public boolean isRoot()
public Repository getRepository()
getRepository
in class TreeEntry
public boolean isLoaded()
public void unload()
public FileTreeEntry addFile(String name) throws IOException
name
- NameFileTreeEntry
for the added file.IOException
public FileTreeEntry addFile(byte[] s, int offset) throws IOException
s
- an array containing the nameoffset
- when the name starts in the tree.FileTreeEntry
for the added file.IOException
public Tree addTree(String name) throws IOException
name
- NameFileTreeEntry
for the added tree.IOException
public Tree addTree(byte[] s, int offset) throws IOException
s
- an array containing the nameoffset
- when the name starts in the tree.FileTreeEntry
for the added tree.IOException
public void addEntry(TreeEntry e) throws IOException
e
- IOException
public int memberCount() throws IOException
IOException
public TreeEntry[] members() throws IOException
100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 a.b 040000 tree 4277b6e69d25e5efa77c455340557b384a4c018a a 100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 a:b
IOException
public boolean existsTree(String path) throws IOException
path
- to the tree.IOException
public boolean existsBlob(String path) throws IOException
path
- of the non-tree entry.IOException
public TreeEntry findBlobMember(String s) throws IOException
s
- blob nameTreeEntry
representing an object with the specified
relative path.IOException
public TreeEntry findTreeMember(String s) throws IOException
s
- Tree NameIOException
public byte[] format() throws IOException
IOException
- the tree cannot be loaded, or its not in a writable state.Copyright © 2013. All Rights Reserved.