Class WorkingTreeIterator.Entry
- Direct Known Subclasses:
FileTreeIterator.FileEntry
- Enclosing class:
- WorkingTreeIterator
- Since:
- 5.0
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) byte[](package private) int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) voidencodeName(CharsetEncoder enc) abstract longDeprecated.abstract InstantGet the last modified time of this entry.abstract longGet the byte length of this entry.abstract FileModegetMode()Get the type of this entry.abstract StringgetName()Get the name of this entry within its directory.abstract InputStreamObtain an input stream to read the file content.toString()
-
Field Details
-
encodedName
byte[] encodedName -
encodedNameLen
int encodedNameLen
-
-
Constructor Details
-
Entry
public Entry()
-
-
Method Details
-
encodeName
-
toString
-
getMode
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.
- Returns:
- a file mode constant from
FileMode.
-
getLength
public abstract long getLength()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.
- Returns:
- size of this file, in bytes.
-
getLastModified
Deprecated.usegetLastModifiedInstant()insteadGet 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.
- Returns:
- time since the epoch (in ms) of the last change.
-
getLastModifiedInstant
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.
- Returns:
- time of the last change.
- Since:
- 5.1.9
-
getName
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.
- Returns:
- name of the entry.
-
openInputStream
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.
- Returns:
- a stream to read from the file.
- Throws:
IOException- the file could not be opened for reading.
-
getLastModifiedInstant()instead