Package org.apache.commons.io.input
Interface Tailer.Tailable
- Enclosing class:
- Tailer
public static interface Tailer.Tailable
A tailable resource like a file.
- Since:
- 2.12.0
-
Method Summary
Modifier and TypeMethodDescriptiongetRandomAccess
(String mode) Creates a random access file stream to read.boolean
Tests if this tailable is newer than the specifiedFileTime
.Gets the last modificationFileTime
.long
size()
Gets the size of this tailable.
-
Method Details
-
getRandomAccess
Creates a random access file stream to read.- Parameters:
mode
- the access mode, by default this is forRandomAccessFile
.- Returns:
- a random access file stream to read.
- Throws:
FileNotFoundException
- if the tailable object does not exist.
-
isNewer
Tests if this tailable is newer than the specifiedFileTime
.- Parameters:
fileTime
- the file time reference.- Returns:
- true if the
File
exists and has been modified after the givenFileTime
. - Throws:
IOException
- if an I/O error occurs.
-
lastModifiedFileTime
Gets the last modificationFileTime
.- Returns:
- See
Files.getLastModifiedTime(Path, LinkOption...)
. - Throws:
IOException
- if an I/O error occurs.
-
size
Gets the size of this tailable.- Returns:
- The size, in bytes, of this tailable, or
0
if the file does not exist. Some operating systems may return0
for path names denoting system-dependent entities such as devices or pipes. - Throws:
IOException
- if an I/O error occurs.
-