|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jgit.treewalk.AbstractTreeIterator
org.eclipse.jgit.treewalk.WorkingTreeIterator
org.eclipse.jgit.treewalk.FileTreeIterator
public class FileTreeIterator
Working directory iterator for standard Java IO.
This iterator uses the standard java.io
package to read the
specified working directory as part of a TreeWalk
.
Nested Class Summary | |
---|---|
static class |
FileTreeIterator.FileEntry
Wrapper for a standard Java IO file |
Nested classes/interfaces inherited from class org.eclipse.jgit.treewalk.WorkingTreeIterator |
---|
WorkingTreeIterator.Entry, WorkingTreeIterator.MetadataDiff |
Field Summary | |
---|---|
protected File |
directory
the starting directory. |
protected FS |
fs
the file system abstraction which will be necessary to perform certain file system operations. |
Fields inherited from class org.eclipse.jgit.treewalk.WorkingTreeIterator |
---|
EOF, repository |
Fields inherited from class org.eclipse.jgit.treewalk.AbstractTreeIterator |
---|
DEFAULT_PATH_SIZE, mode, path, pathLen, pathOffset, zeroid |
Constructor Summary | |
---|---|
|
FileTreeIterator(File root,
FS fs,
WorkingTreeOptions options)
Create a new iterator to traverse the given directory and its children. |
|
FileTreeIterator(Repository repo)
Create a new iterator to traverse the work tree and its children. |
protected |
FileTreeIterator(WorkingTreeIterator p,
File root,
FS fs)
Create a new iterator to traverse a subdirectory. |
Method Summary | |
---|---|
AbstractTreeIterator |
createSubtreeIterator(ObjectReader reader)
Create a new iterator for the current entry's subtree. |
File |
getDirectory()
|
File |
getEntryFile()
|
protected byte[] |
idSubmodule(WorkingTreeIterator.Entry e)
Get submodule id for given entry. |
Methods inherited from class org.eclipse.jgit.treewalk.WorkingTreeIterator |
---|
back, compareMetadata, current, eof, first, getEntryContentLength, getEntryLastModified, getEntryLength, getIndexFileMode, getOptions, hasId, idBuffer, idOffset, idSubmodule, init, initRootIterator, isEntryIgnored, isEntryIgnored, isModeDifferent, isModified, next, openEntryStream, reset, setDirCacheIterator |
Methods inherited from class org.eclipse.jgit.treewalk.AbstractTreeIterator |
---|
createEmptyTreeIterator, createSubtreeIterator, ensurePathCapacity, getEntryFileMode, getEntryObjectId, getEntryObjectId, getEntryPathBuffer, getEntryPathHashCode, getEntryPathLength, getEntryPathString, getEntryRawMode, getName, getNameLength, getNameOffset, growPath, idEqual, pathCompare, pathCompare, skip, stopWalk, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final File directory
protected final FS fs
Constructor Detail |
---|
public FileTreeIterator(Repository repo)
repo
- the repository whose working tree will be scanned.public FileTreeIterator(File root, FS fs, WorkingTreeOptions options)
root
- the starting directory. This directory should correspond to
the root of the repository.fs
- the file system abstraction which will be necessary to perform
certain file system operations.options
- working tree options to be usedprotected FileTreeIterator(WorkingTreeIterator p, File root, FS fs)
p
- the parent iterator we were created from.fs
- the file system abstraction which will be necessary to perform
certain file system operations.root
- the subdirectory. This should be a directory contained within
the parent directory.Method Detail |
---|
public AbstractTreeIterator createSubtreeIterator(ObjectReader reader) throws IncorrectObjectTypeException, IOException
AbstractTreeIterator
The parent reference of the iterator must be this
,
otherwise the caller would not be able to exit out of the subtree
iterator correctly and return to continue walking this
.
createSubtreeIterator
in class AbstractTreeIterator
reader
- reader to load the tree data from.
IncorrectObjectTypeException
- the current entry is not actually a tree and cannot be parsed
as though it were a tree.
IOException
- a loose object or pack file could not be read.public File getDirectory()
public File getEntryFile()
new
File(getDirectory(), getEntryPath())
but may be faster by
reusing an internal File instance.protected byte[] idSubmodule(WorkingTreeIterator.Entry e)
WorkingTreeIterator
idSubmodule
in class WorkingTreeIterator
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |