This iterator uses the standard java.io package to read the
specified working directory as part of a
org..
| Modifier and Type | Class and Description |
|---|---|
| public static class | FileTreeIterator.
A default implementation of a FileModeStrategy; defaults to treating nested .git directories as gitlinks, etc. |
| public static class | FileTreeIterator.
Wrapper for a standard Java IO file |
| public static interface | FileTreeIterator.
An interface representing the methods used to determine the FileMode for a FileEntry. |
| public static class | FileTreeIterator.
A FileModeStrategy that implements native git's DIR_NO_GITLINKS behavior. |
| Modifier and Type | Field and Description |
|---|---|
| protected final File | directory
the starting directory of this Iterator. |
| protected final FileTreeIterator. | fileModeStrategy
the strategy used to compute the FileMode for a FileEntry. |
| protected final FS | fs
the file system abstraction which will be necessary to perform certain file system operations. |
| Access | Constructor and Description |
|---|---|
| public | FileTreeIterator(Repository
the repository whose working tree will be scanned. repo)Create a new iterator to traverse the work tree and its children. |
| public | FileTreeIterator(Repository
the repository whose working tree will be scanned. repo, FileTreeIterator.the strategy to use to determine the FileMode for a FileEntry;
controls gitlinks etc. fileModeStrategyCreate a new iterator to traverse the work tree and its children. |
| public | FileTreeIterator(File
the starting directory. This directory should correspond to
the root of the repository. root, FS the file system abstraction which will be necessary to perform
certain file system operations. fs, WorkingTreeOptions working tree options to be used options)Create a new iterator to traverse the given directory and its children. |
| public | FileTreeIterator(final File
the starting directory. This directory should correspond to
the root of the repository. root, FS the file system abstraction which will be necessary to perform
certain file system operations. fs, WorkingTreeOptions working tree options to be used options, FileTreeIterator.the strategy to use to determine the FileMode for a FileEntry;
controls gitlinks etc. fileModeStrategyCreate a new iterator to traverse the given directory and its children. |
| protected | FileTreeIterator(final FileTreeIterator
the parent iterator we were created from. p, final File the subdirectory. This should be a directory contained within
the parent directory. root, FS the file system abstraction which will be necessary to perform
certain file system operations. fs)Create a new iterator to traverse a subdirectory. |
| protected | FileTreeIterator(final WorkingTreeIterator
the parent iterator we were created from. p, final File the subdirectory. This should be a directory contained within
the parent directory root, FS the file system abstraction which will be necessary to perform
certain file system operations. fs, FileTreeIterator.the strategy to use to determine the FileMode for a given
FileEntry. fileModeStrategyCreate a new iterator to traverse a subdirectory, given the specified FileModeStrategy. |
| Modifier and Type | Method and Description |
|---|---|
| public AbstractTreeIterator | createSubtreeIterator(ObjectReader
reader to load the tree data from. reader)Implements abstract org. Create a new iterator for the current entry's subtree. |
| protected AbstractTreeIterator | Returns: a new iterator that walks over the current subtree.Create a new iterator for the current entry's subtree. |
| private WorkingTreeIterator. | |
| public File | |
| public File | Returns: The location of the working file. This is the same asnew
File(getDirectory(), getEntryPath()) but may be faster by
reusing an internal File instance.Get the location of the working file. |
| protected byte[] | idSubmodule(WorkingTreeIterator.
Overrides org. Get submodule id for given entry. |
| protected String | readSymlinkTarget(WorkingTreeIterator.
to read entryOverrides org. Reads the target of a symlink as a string. |
| directory | back to summary |
|---|---|
| protected final File directory the starting directory of this Iterator. All entries are located directly in this directory. | |
| fileModeStrategy | back to summary |
|---|---|
| protected final FileTreeIterator. the strategy used to compute the FileMode for a FileEntry. Can be used to control things such as whether to recurse into a directory or create a gitlink.
| |
| fs | back to summary |
|---|---|
| protected final FS fs the file system abstraction which will be necessary to perform certain file system operations. | |
| FileTreeIterator | back to summary |
|---|---|
| public FileTreeIterator(Repository repo) Create a new iterator to traverse the work tree and its children.
| |
| FileTreeIterator | back to summary |
|---|---|
| public FileTreeIterator(Repository repo, FileTreeIterator. Create a new iterator to traverse the work tree and its children.
| |
| FileTreeIterator | back to summary |
|---|---|
| public FileTreeIterator(File root, FS fs, WorkingTreeOptions options) Create a new iterator to traverse the given directory and its children.
| |
| FileTreeIterator | back to summary |
|---|---|
| public FileTreeIterator(final File root, FS fs, WorkingTreeOptions options, FileTreeIterator. Create a new iterator to traverse the given directory and its children.
| |
| FileTreeIterator | back to summary |
|---|---|
| protected FileTreeIterator(final FileTreeIterator p, final File root, FS fs) Create a new iterator to traverse a subdirectory.
| |
| FileTreeIterator | back to summary |
|---|---|
| protected FileTreeIterator(final WorkingTreeIterator p, final File root, FS fs, FileTreeIterator. Create a new iterator to traverse a subdirectory, given the specified FileModeStrategy.
| |
| createSubtreeIterator | back to summary |
|---|---|
| public AbstractTreeIterator createSubtreeIterator(ObjectReader reader) throws IncorrectObjectTypeException, IOException Implements abstract org. Doc from org. Create a new iterator for the current entry's subtree.
The parent reference of the iterator must be
| |
| enterSubtree | back to summary |
|---|---|
| protected AbstractTreeIterator enterSubtree() Create a new iterator for the current entry's subtree.
The parent reference of the iterator must be
| |
| entries | back to summary |
|---|---|
| private WorkingTreeIterator. | |
| getDirectory | back to summary |
|---|---|
| public File getDirectory() Getter for the field
| |
| getEntryFile | back to summary |
|---|---|
| public File getEntryFile() Get the location of the working file.
| |
| idSubmodule | back to summary |
|---|---|
| protected byte[] idSubmodule(WorkingTreeIterator. Overrides org. Doc from org. Get submodule id for given entry.
| |
| readSymlinkTarget | back to summary |
|---|---|
| protected String readSymlinkTarget(WorkingTreeIterator. Overrides org. Doc from org. Reads the target of a symlink as a string. This default implementation fully reads the entry's input stream and converts it to a normalized string. Subclasses may override to provide more specialized implementations.
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final FileTreeIterator. | INSTANCE
a singleton instance of the default FileModeStrategy |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public FileMode | getMode(File
the file to return a FileMode for f, FS.the attributes of a file attributesImplements org. Compute the FileMode for a given File, based on its attributes. |
| INSTANCE | back to summary |
|---|---|
| public static final FileTreeIterator. a singleton instance of the default FileModeStrategy | |
| DefaultFileModeStrategy | back to summary |
|---|---|
| public DefaultFileModeStrategy() | |
| getMode | back to summary |
|---|---|
| public FileMode getMode(File f, FS. Implements org. Doc from org. Compute the FileMode for a given File, based on its attributes.
| |
| Modifier and Type | Field and Description |
|---|---|
| private FS. | |
| private FS | |
| private final FileMode |
| Access | Constructor and Description |
|---|---|
| public | |
| public | FileEntry(File
file f, FS file system fs, FileTreeIterator.the strategy to use when determining the FileMode of a
file; controls gitlinks etc. fileModeStrategyCreate a new file entry given the specified FileModeStrategy |
| public | FileEntry(File
file f, FS file system fs, FS.of the file attributes,the strategy to use when determining the FileMode of a
file; controls gitlinks etc. fileModeStrategyCreate a new file entry given the specified FileModeStrategy |
| Modifier and Type | Method and Description |
|---|---|
| public File | |
| public Instant | getLastModifiedInstant()
Implements abstract org. Get the last modified time of this entry. |
| public long | getLength()
Implements abstract org. Get the byte length of this entry. |
| public FileMode | getMode()
Implements abstract org. Get the type of this entry. |
| public String | getName()
Implements abstract org. Get the name of this entry within its directory. |
| public InputStream | openInputStream()
Implements abstract org. Obtain an input stream to read the file content. |
| attributes | back to summary |
|---|---|
| private FS. | |
| fs | back to summary |
|---|---|
| private FS fs | |
| mode | back to summary |
|---|---|
| private final FileMode mode | |
| FileEntry | back to summary |
|---|---|
| public FileEntry(File f, FS fs) Create a new file entry. | |
| FileEntry | back to summary |
|---|---|
| public FileEntry(File f, FS fs, FileTreeIterator. Create a new file entry given the specified FileModeStrategy
| |
| FileEntry | back to summary |
|---|---|
| public FileEntry(File f, FS fs, FS. Create a new file entry given the specified FileModeStrategy
| |
| getFile | back to summary |
|---|---|
| public File getFile() Get the underlying file of this entry.
| |
| getLastModifiedInstant | back to summary |
|---|---|
| public Instant getLastModifiedInstant() Implements abstract org. Doc from org. Get the last modified time of this entry. Note Efficient implementation required. The implementation of this method must be efficient. If a subclass needs to compute the value they should cache the reference within an instance member instead. | |
| getLength | back to summary |
|---|---|
| public long getLength() Implements abstract org. Doc from org. Get the byte length of this entry. Note Efficient implementation required. The implementation of this method must be efficient. If a subclass needs to compute the value they should cache the reference within an instance member instead.
| |
| getMode | back to summary |
|---|---|
| public FileMode getMode() Implements abstract org. Doc from org. Get the type of this entry. Note Efficient implementation required. The implementation of this method must be efficient. If a subclass needs to compute the value they should cache the reference within an instance member instead. | |
| getName | back to summary |
|---|---|
| public String getName() Implements abstract org. Doc from org. Get the name of this entry within its directory. Efficient implementations are not required. The caller will obtain the name only once and cache it once obtained. | |
| openInputStream | back to summary |
|---|---|
| public InputStream openInputStream() throws IOException Implements abstract org. Doc from org. Obtain an input stream to read the file content. Efficient implementations are not required. The caller will usually obtain the stream only once per entry, if at all. The input stream should not use buffering if the implementation can avoid it. The caller will buffer as necessary to perform efficient block IO operations. The caller will close the stream once complete.
| |
| Modifier and Type | Method and Description |
|---|---|
| public FileMode | Returns: a FileMode indicating whether the file is a regular file, a directory, a gitlink, etc.the file to return a FileMode for f, FS.the attributes of a file attributesCompute the FileMode for a given File, based on its attributes. |
| getMode | back to summary |
|---|---|
| public FileMode getMode(File f, FS. Compute the FileMode for a given File, based on its attributes.
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final FileTreeIterator. | INSTANCE
a singleton instance of the default FileModeStrategy |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public FileMode | getMode(File
the file to return a FileMode for f, FS.the attributes of a file attributesImplements org. Compute the FileMode for a given File, based on its attributes. |
| INSTANCE | back to summary |
|---|---|
| public static final FileTreeIterator. a singleton instance of the default FileModeStrategy | |
| NoGitlinksStrategy | back to summary |
|---|---|
| public NoGitlinksStrategy() | |
| getMode | back to summary |
|---|---|
| public FileMode getMode(File f, FS. Implements org. Doc from org. Compute the FileMode for a given File, based on its attributes.
| |