public static class FileTreeIterator.FileEntry extends WorkingTreeIterator.Entry
Constructor and Description |
---|
FileEntry(File f,
FS fs)
Create a new file entry.
|
FileEntry(File f,
FS fs,
FileTreeIterator.FileModeStrategy fileModeStrategy)
Create a new file entry given the specified FileModeStrategy
|
FileEntry(File f,
FS fs,
FS.Attributes attributes,
FileTreeIterator.FileModeStrategy fileModeStrategy)
Create a new file entry given the specified FileModeStrategy
|
Modifier and Type | Method and Description |
---|---|
File |
getFile()
Get the underlying file of this entry.
|
long |
getLastModified()
Deprecated.
|
Instant |
getLastModifiedInstant()
Get the last modified time of this entry.
|
long |
getLength()
Get the byte length of this entry.
|
FileMode |
getMode()
Get the type of this entry.
|
String |
getName()
Get the name of this entry within its directory.
|
InputStream |
openInputStream()
Obtain an input stream to read the file content.
|
toString
public FileEntry(File f, FS fs)
f
- filefs
- file systempublic FileEntry(File f, FS fs, FileTreeIterator.FileModeStrategy fileModeStrategy)
f
- filefs
- file systemfileModeStrategy
- the strategy to use when determining the FileMode of a
file; controls gitlinks etc.public FileEntry(File f, FS fs, FS.Attributes attributes, FileTreeIterator.FileModeStrategy fileModeStrategy)
f
- filefs
- file systemattributes
- of the filefileModeStrategy
- the strategy to use when determining the FileMode of a
file; controls gitlinks etc.public FileMode getMode()
WorkingTreeIterator.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
in class WorkingTreeIterator.Entry
FileMode
.public String getName()
WorkingTreeIterator.Entry
Efficient implementations are not required. The caller will obtain the name only once and cache it once obtained.
getName
in class WorkingTreeIterator.Entry
public long getLength()
WorkingTreeIterator.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
in class WorkingTreeIterator.Entry
@Deprecated public long getLastModified()
WorkingTreeIterator.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.
getLastModified
in class WorkingTreeIterator.Entry
public Instant getLastModifiedInstant()
WorkingTreeIterator.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.
getLastModifiedInstant
in class WorkingTreeIterator.Entry
public InputStream openInputStream() throws IOException
WorkingTreeIterator.Entry
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.
openInputStream
in class WorkingTreeIterator.Entry
IOException
- the file could not be opened for reading.public File getFile()
Copyright © 2020 Eclipse JGit Project. All rights reserved.