Class FileTreeIterator.FileEntry
- Enclosing class:
- FileTreeIterator
-
Field Summary
FieldsFields inherited from class org.eclipse.jgit.treewalk.WorkingTreeIterator.Entry
encodedName, encodedNameLen -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new file entry.FileEntry(File f, FS fs, FileTreeIterator.FileModeStrategy fileModeStrategy) Create a new file entry given the specified FileModeStrategyFileEntry(File f, FS fs, FS.Attributes attributes, FileTreeIterator.FileModeStrategy fileModeStrategy) Create a new file entry given the specified FileModeStrategy -
Method Summary
Modifier and TypeMethodDescriptiongetFile()Get the underlying file of this entry.longDeprecated.Get the last modified time of this entry.longGet the byte length of this entry.getMode()Get the type of this entry.getName()Get the name of this entry within its directory.Obtain an input stream to read the file content.Methods inherited from class org.eclipse.jgit.treewalk.WorkingTreeIterator.Entry
encodeName, toString
-
Field Details
-
mode
-
attributes
-
fs
-
-
Constructor Details
-
FileEntry
Create a new file entry.- Parameters:
f- filefs- file system
-
FileEntry
Create a new file entry given the specified FileModeStrategy- Parameters:
f- filefs- file systemfileModeStrategy- the strategy to use when determining the FileMode of a file; controls gitlinks etc.- Since:
- 4.3
-
FileEntry
public FileEntry(File f, FS fs, FS.Attributes attributes, FileTreeIterator.FileModeStrategy fileModeStrategy) Create a new file entry given the specified FileModeStrategy- Parameters:
f- filefs- file systemattributes- of the filefileModeStrategy- the strategy to use when determining the FileMode of a file; controls gitlinks etc.- Since:
- 5.0
-
-
Method Details
-
getMode
Description copied from class:WorkingTreeIterator.EntryGet 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.
- Specified by:
getModein classWorkingTreeIterator.Entry- Returns:
- a file mode constant from
FileMode.
-
getName
Description copied from class:WorkingTreeIterator.EntryGet 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.
- Specified by:
getNamein classWorkingTreeIterator.Entry- Returns:
- name of the entry.
-
getLength
public long getLength()Description copied from class:WorkingTreeIterator.EntryGet 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.
- Specified by:
getLengthin classWorkingTreeIterator.Entry- Returns:
- size of this file, in bytes.
-
getLastModified
Deprecated.Description copied from class:WorkingTreeIterator.EntryGet 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.
- Specified by:
getLastModifiedin classWorkingTreeIterator.Entry- Returns:
- time since the epoch (in ms) of the last change.
-
getLastModifiedInstant
Description copied from class:WorkingTreeIterator.EntryGet 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.
- Specified by:
getLastModifiedInstantin classWorkingTreeIterator.Entry- Returns:
- time of the last change.
- Since:
- 5.1.9
-
openInputStream
Description copied from class:WorkingTreeIterator.EntryObtain 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.
- Specified by:
openInputStreamin classWorkingTreeIterator.Entry- Returns:
- a stream to read from the file.
- Throws:
IOException- the file could not be opened for reading.
-
getFile
Get the underlying file of this entry.- Returns:
- the underlying file of this entry
-