org.eclipse.jgit.treewalk.TreeWalk .
Most applications will want to use the standard implementation of this
iterator, org., as that does
all IO through the standard java.io package. Plugins for a Java
based IDE may however wish to create their own implementations of this class
to allow traversal of the IDE's project space, as well as benefit from any
caching the IDE may have.
FileTreeIterator
| Modifier and Type | Class and Description |
|---|---|
| public abstract static class | WorkingTreeIterator.
A single entry within a working directory tree. |
| private static class | |
| private static class | |
| public static enum | WorkingTreeIterator.
The result of a metadata-comparison between the current entry and a
|
| private static class | WorkingTreeIterator.
Magic type indicating we know rules exist, but they aren't loaded. |
| private static class | WorkingTreeIterator.
Magic type indicating we know rules exist, but they aren't loaded. |
| private static class | WorkingTreeIterator.
Magic type indicating there may be rules for the top level. |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final int | BUFFER_SIZE
Size we perform file IO in if we have to read and hash a file. |
| private long | canonLen
Cached canonical length, initialized from |
| private Holder | cleanFilterCommandHolder
cached clean filter command. |
| private byte[] | contentId
The |
| private int | |
| private int | contentIdOffset
The offset of the content id in |
| private static final byte[] | |
| private WorkingTreeIterator. | entries
List of entries obtained from the subclass. |
| private static final Comparator | |
| private int | |
| protected static final WorkingTreeIterator. | EOF
An empty entry array, suitable for |
| private Holder | eolStreamTypeHolder
cached eol stream type. |
| private static final byte[] | |
| private IgnoreNode | ignoreNode
If there is a .gitignore file present, the parsed rules from it. |
| private static final int | |
| private static final long | MAXIMUM_FILE_SIZE_TO_READ_FULLY
Maximum size of files which may be read fully into memory for performance reasons. |
| private int | |
| protected Repository | repository
Repository that is the root level being iterated over |
| private final WorkingTreeIterator. | state
Inherited state of this iterator, describing working tree, etc. |
| private final InstantComparator | timestampComparator
A comparator for |
| Access | Constructor and Description |
|---|---|
| protected | WorkingTreeIterator(WorkingTreeOptions
working tree options to be used options)Create a new iterator with no parent. |
| protected | WorkingTreeIterator(final String
position of this iterator in the repository tree. The value
may be null or the empty string to indicate the prefix is the
root of the repository. A trailing slash ('/') is
automatically appended if the prefix does not end in '/'. prefix, WorkingTreeOptions working tree options to be used options)Create a new iterator with no parent and a prefix. |
| protected | WorkingTreeIterator(WorkingTreeIterator
parent tree iterator. p)Create an iterator for a subtree of an existing iterator. |
| Modifier and Type | Method and Description |
|---|---|
| public void | back(int
number of entries to move the iterator by. Must be a positive,
non-zero integer. delta)Implements abstract org. Move to prior entry, populating this iterator with the entry data. |
| public WorkingTreeIterator. | Returns: aorg.
which tells whether and how the entries metadata differthe entry)org. to compare
withCompare the metadata (mode, length, modification-timestamp) of the
current entry and a |
| private byte[] | |
| private static long | |
| private static String | |
| private boolean | Returns: true if the content doesn't match,
false if it matchesthe entry to be checked entry, ObjectReader acccess to repository data if necessary reader)Compares the entries content with the content in the filesystem. |
| protected WorkingTreeIterator. | |
| public boolean | eof()
Implements abstract org. Is this tree iterator at its EOF point (no more entries)? |
| private InputStream | |
| public boolean | first()
Implements abstract org. Is this tree iterator positioned on its first entry? |
| public String | Returns: the clean filter command for the current entry ornull if no such command is definedGet the clean filter command for the current entry. |
| protected DirCacheIterator | Returns: the DirCacheIterator, ornull if not set or not at the
current entryRetrieves the |
| public AttributesNode | Returns: theorg. for the
current entry.Retrieves the |
| public long | Returns: size of the content, in bytesGet the filtered input length of this entry |
| public Instant | Returns: last modified time of this fileGet the last modified time of this entry. |
| public long | |
| public CoreConfig. | Returns: the eol stream type for the current entry ornull if
it cannot be determined. When state or state.walk is null or the
org. is not based on a
org. then null is returned.Get the eol stream type for the current entry. |
| private CoreConfig. | Returns: the eol stream type for the current entry ornull if
it cannot be determined. When state or state.walk is null or the
TreeWalk is not based on a Repository then null
is returned.The operationtype (checkin/checkout) which should be used opType
|
| private IgnoreNode | |
| public FileMode | Returns: index file modeorg. positioned
at the same entry as this iterator or null if no
org. is
available at this iterator's current entryGet the file mode to use for the current entry when it is to be updated in the index. |
| public WorkingTreeOptions | |
| private static String | |
| public Repository | Returns: theRepositoryRetrieves the |
| private boolean | Returns: true if the file in the index is not binary and has CR/LF
line endings, false otherwiseiterator pointing to the current entry for the file in the
index dirCache)Determines whether the file was committed un-normalized. |
| public boolean | hasId()
Implements abstract org. Whether the entry has a valid ObjectId. |
| public byte[] | idBuffer()
Implements abstract org. Get the byte array buffer object IDs must be copied out of. |
| private byte[] | |
| public int | idOffset()
Implements abstract org. Get the position within |
| protected byte[] | Returns: non-null submodule idGet submodule id for given entry. |
| protected byte[] | Returns: non-null submodule ida directory, WorkingTreeIterator.java. object.Get submodule id using the repository at the location of the entry relative to the directory. |
| protected void | init(WorkingTreeIterator.
files in the subtree of the work tree this iterator operates
on listConstructor helper. |
| protected void | initRootIterator(Repository
the repository. repo)Initialize this iterator for the root level of a repository. |
| private static boolean | |
| private boolean | |
| private boolean | |
| public boolean | Returns: true if the entry was ignored by an ignore rule file.Determine if the current entry path is ignored by an ignore rule. |
| protected boolean | Returns: true if the entry is ignored by an ignore rule.the length of the path in the path buffer. pLen)Determine if the entry path is ignored by an ignore rule. |
| private boolean | Returns: true if the entry is ignored by an ignore rule.the length of the path in the path buffer. pLen, int the original iterator file mode fileMode)Determine if the entry path is ignored by an ignore rule. |
| public boolean | Returns: true if different, false otherwisean int. rawMode)Is the file mode of the current entry different than the given raw mode? |
| public boolean | Returns: true if content is most likely different.the entry from the dircache we want to compare against entry, boolean True if the actual file content should be checked if
modification time differs. forceContentCheck, ObjectReader access to repository objects if necessary. Should not be null. reader)Checks whether this entry differs from a given entry from the
|
| public boolean | isWorkTree()
Overrides org. Whether or not this Iterator is iterating through the working tree. |
| public void | next(int
number of entries to move the iterator by. Must be a positive,
non-zero integer. delta)Implements abstract org. Move to next entry, populating this iterator with the entry data. |
| public InputStream | Returns: a stream to read from the file.Obtain an input stream to read the file content. |
| private void | |
| private InputStream | possiblyFilteredInputStream(final WorkingTreeIterator.
|
| private long | |
| private static String | |
| protected String | Returns: the entry's content as a normalized stringto read entryReads the target of a symlink as a string. |
| public void | reset()
Overrides org. Position this iterator on the first entry. |
| private static void | |
| public void | setDirCacheIterator(TreeWalk
the walk that will be advancing this iterator. walk, int index of the matching
treeId)org..Define the matching |
| public void | setWalkIgnoredDirectories(boolean
false to skip ignored directories, if possible;
true to always include them in the walkDefines whether this |
| public boolean | Returns: true if it does, false otherwiseTells whether this |