private static final class Tailer.TailablePath extends java.lang.Object implements Tailer.Tailable
Path
.Modifier and Type | Field and Description |
---|---|
private java.nio.file.LinkOption[] |
linkOptions |
private java.nio.file.Path |
path |
Modifier | Constructor and Description |
---|---|
private |
TailablePath(java.nio.file.Path path,
java.nio.file.LinkOption... linkOptions) |
Modifier and Type | Method and Description |
---|---|
(package private) java.nio.file.Path |
getPath() |
Tailer.RandomAccessResourceBridge |
getRandomAccess(java.lang.String mode)
Creates a random access file stream to read.
|
boolean |
isNewer(java.nio.file.attribute.FileTime fileTime)
Tests if this tailable is newer than the specified
FileTime . |
java.nio.file.attribute.FileTime |
lastModifiedFileTime()
Gets the last modification
FileTime . |
long |
size()
Gets the size of this tailable.
|
java.lang.String |
toString() |
private final java.nio.file.Path path
private final java.nio.file.LinkOption[] linkOptions
private TailablePath(java.nio.file.Path path, java.nio.file.LinkOption... linkOptions)
java.nio.file.Path getPath()
public Tailer.RandomAccessResourceBridge getRandomAccess(java.lang.String mode) throws java.io.FileNotFoundException
Tailer.Tailable
getRandomAccess
in interface Tailer.Tailable
mode
- the access mode, by default this is for RandomAccessFile
.java.io.FileNotFoundException
- if the tailable object does not exist.public boolean isNewer(java.nio.file.attribute.FileTime fileTime) throws java.io.IOException
Tailer.Tailable
FileTime
.isNewer
in interface Tailer.Tailable
fileTime
- the file time reference.File
exists and has been modified after the given FileTime
.java.io.IOException
- if an I/O error occurs.public java.nio.file.attribute.FileTime lastModifiedFileTime() throws java.io.IOException
Tailer.Tailable
FileTime
.lastModifiedFileTime
in interface Tailer.Tailable
Files.getLastModifiedTime(Path, LinkOption...)
.java.io.IOException
- if an I/O error occurs.public long size() throws java.io.IOException
Tailer.Tailable
size
in interface Tailer.Tailable
0
if the file does not exist. Some operating systems may
return 0
for path names denoting system-dependent entities such as devices or pipes.java.io.IOException
- if an I/O error occurs.public java.lang.String toString()
toString
in class java.lang.Object