How do you continuously read a file in Java?

前端 未结 4 1039
野的像风
野的像风 2020-12-17 14:36

I\'m trying to figure out how to continuously read a file and once there is a new line added, output the line. I\'m doing this using a sleep thread however it just seems to

4条回答
  •  独厮守ぢ
    2020-12-17 15:35

    Also consider org.apache.commons.io.input.Tailer if you do not have the requirement of writing this from scratch.

提交回复
热议问题