org.eclipse.jgit.treewalk
Class FileTreeIterator

java.lang.Object
  extended by org.eclipse.jgit.treewalk.AbstractTreeIterator
      extended by org.eclipse.jgit.treewalk.WorkingTreeIterator
          extended by org.eclipse.jgit.treewalk.FileTreeIterator

public class FileTreeIterator
extends WorkingTreeIterator

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
 
Field Summary
 
Fields inherited from class org.eclipse.jgit.treewalk.WorkingTreeIterator
EOF
 
Fields inherited from class org.eclipse.jgit.treewalk.AbstractTreeIterator
DEFAULT_PATH_SIZE, mode, path, pathLen, pathOffset, zeroid
 
Constructor Summary
  FileTreeIterator(java.io.File root)
          Create a new iterator to traverse the given directory and its children.
protected FileTreeIterator(FileTreeIterator p, java.io.File root)
          Create a new iterator to traverse a subdirectory.
 
Method Summary
 AbstractTreeIterator createSubtreeIterator(Repository repo)
          Create a new iterator for the current entry's subtree.
 
Methods inherited from class org.eclipse.jgit.treewalk.WorkingTreeIterator
back, current, eof, first, getEntryLastModified, getEntryLength, idBuffer, idOffset, init, next
 
Methods inherited from class org.eclipse.jgit.treewalk.AbstractTreeIterator
createEmptyTreeIterator, createSubtreeIterator, ensurePathCapacity, getEntryFileMode, getEntryObjectId, getEntryObjectId, getEntryPathString, getEntryRawMode, getName, getNameLength, growPath, idEqual, pathCompare, skip, stopWalk
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileTreeIterator

public FileTreeIterator(java.io.File root)
Create a new iterator to traverse the given directory and its children.

Parameters:
root - the starting directory. This directory should correspond to the root of the repository.

FileTreeIterator

protected FileTreeIterator(FileTreeIterator p,
                           java.io.File root)
Create a new iterator to traverse a subdirectory.

Parameters:
p - the parent iterator we were created from.
root - the subdirectory. This should be a directory contained within the parent directory.
Method Detail

createSubtreeIterator

public AbstractTreeIterator createSubtreeIterator(Repository repo)
                                           throws IncorrectObjectTypeException,
                                                  java.io.IOException
Description copied from class: AbstractTreeIterator
Create a new iterator for the current entry's subtree.

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.

Specified by:
createSubtreeIterator in class AbstractTreeIterator
Parameters:
repo - repository to load the tree data from.
Returns:
a new parser that walks over the current subtree.
Throws:
IncorrectObjectTypeException - the current entry is not actually a tree and cannot be parsed as though it were a tree.
java.io.IOException - a loose object or pack file could not be read.