Package org.apache.commons.io.input
Class Tailer.TailablePath
java.lang.Object
org.apache.commons.io.input.Tailer.TailablePath
- All Implemented Interfaces:
Tailer.Tailable
- Enclosing class:
Tailer
A tailable for a file
Path
.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) Path
getPath()
getRandomAccess
(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.toString()
-
Field Details
-
path
-
linkOptions
-
-
Constructor Details
-
TailablePath
-
-
Method Details
-
getPath
Path getPath() -
getRandomAccess
Description copied from interface:Tailer.Tailable
Creates a random access file stream to read.- Specified by:
getRandomAccess
in interfaceTailer.Tailable
- 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
Description copied from interface:Tailer.Tailable
Tests if this tailable is newer than the specifiedFileTime
.- Specified by:
isNewer
in interfaceTailer.Tailable
- 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
Description copied from interface:Tailer.Tailable
Gets the last modificationFileTime
.- Specified by:
lastModifiedFileTime
in interfaceTailer.Tailable
- Returns:
- See
Files.getLastModifiedTime(Path, LinkOption...)
. - Throws:
IOException
- if an I/O error occurs.
-
size
Description copied from interface:Tailer.Tailable
Gets the size of this tailable.- Specified by:
size
in interfaceTailer.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.
-
toString
-