Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/theprez/jfiletail
Java "tail" utility (similar to pygtail or logtail2)
https://github.com/theprez/jfiletail
Last synced: 1 day ago
JSON representation
Java "tail" utility (similar to pygtail or logtail2)
- Host: GitHub
- URL: https://github.com/theprez/jfiletail
- Owner: ThePrez
- License: apache-2.0
- Created: 2022-12-06T16:53:04.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-05T21:48:56.000Z (about 2 months ago)
- Last Synced: 2024-12-05T22:27:37.735Z (about 2 months ago)
- Language: Java
- Size: 34.2 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# JFileTail
Java "tail" utility (similar to pygtail or logtail2)This project provides two features:
- An API
- A command-line interfaceEach invocation (API or command line) reads only the portion of the file not read by
previous invocations. It will restart at the beginning of the file if any of the following
are true:
- The file has been replaced
- The file is smaller than at previous invocation## Command-line interface
Future CLI improvements are likely coming, but for now, the invocation is simply to pass in a file name
as the only argument. For instance, if you have saved this tool in `jfiletail.jar`, then you could run:
```
java -jar jfiletail.jar
```## API
Function is accessed solely through the `io.github.theprez.jfiletail.FileNewContentsReader` class, which
implements the standard `Reader` functions. The Reader will only read portions of the file that have not been read
since last invocation.The constructor takes two arguments:
- The `File` you wish to read
- the file's encoding. A special value of `*TAG` is allowed when running on IBM i, which will read the file based
on the filesystem ccsid tag.```java
FileNewContentsReader reader = new FileNewContentsReader(file, "*TAG")
```Maven users can import the dependency with a declaration like this (replace the version with the latest release):
```xmlio.github.theprez
jfiletail
0.0.2```