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
private static final class Tailer.TailablePath extends java.lang.Object implements Tailer.Tailable
A tailable for a filePath.
-
-
Field Summary
Fields Modifier and Type Field Description private java.nio.file.LinkOption[]linkOptionsprivate java.nio.file.Pathpath
-
Constructor Summary
Constructors Modifier Constructor Description privateTailablePath(java.nio.file.Path path, java.nio.file.LinkOption... linkOptions)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) java.nio.file.PathgetPath()Tailer.RandomAccessResourceBridgegetRandomAccess(java.lang.String mode)Creates a random access file stream to read.booleanisNewer(java.nio.file.attribute.FileTime fileTime)Tests if this tailable is newer than the specifiedFileTime.java.nio.file.attribute.FileTimelastModifiedFileTime()Gets the last modificationFileTime.longsize()Gets the size of this tailable.java.lang.StringtoString()
-
-
-
Method Detail
-
getPath
java.nio.file.Path getPath()
-
getRandomAccess
public Tailer.RandomAccessResourceBridge getRandomAccess(java.lang.String mode) throws java.io.FileNotFoundException
Description copied from interface:Tailer.TailableCreates a random access file stream to read.- Specified by:
getRandomAccessin interfaceTailer.Tailable- Parameters:
mode- the access mode, by default this is forRandomAccessFile.- Returns:
- a random access file stream to read.
- Throws:
java.io.FileNotFoundException- if the tailable object does not exist.
-
isNewer
public boolean isNewer(java.nio.file.attribute.FileTime fileTime) throws java.io.IOExceptionDescription copied from interface:Tailer.TailableTests if this tailable is newer than the specifiedFileTime.- Specified by:
isNewerin interfaceTailer.Tailable- Parameters:
fileTime- the file time reference.- Returns:
- true if the
Fileexists and has been modified after the givenFileTime. - Throws:
java.io.IOException- if an I/O error occurs.
-
lastModifiedFileTime
public java.nio.file.attribute.FileTime lastModifiedFileTime() throws java.io.IOExceptionDescription copied from interface:Tailer.TailableGets the last modificationFileTime.- Specified by:
lastModifiedFileTimein interfaceTailer.Tailable- Returns:
- See
Files.getLastModifiedTime(Path, LinkOption...). - Throws:
java.io.IOException- if an I/O error occurs.
-
size
public long size() throws java.io.IOExceptionDescription copied from interface:Tailer.TailableGets the size of this tailable.- Specified by:
sizein interfaceTailer.Tailable- Returns:
- The size, in bytes, of this tailable, or
0if the file does not exist. Some operating systems may return0for path names denoting system-dependent entities such as devices or pipes. - Throws:
java.io.IOException- if an I/O error occurs.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-