public interface LineReader extends Closeable
| Modifier and Type | Interface and Description |
|---|---|
static interface |
LineReader.LineConsumer
Represents a line consumer which signals with its return value whether he will accept more input if available.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
boolean |
exists(String pathToTest)
Test whether the given file path exists.
|
ResultData |
readLines(LineReader.LineConsumer lineConsumer)
Read line by line until the current end.
|
void |
removePath()
Remove the current file path.
|
void |
setPath(String path)
Set the file path or null if you want to remove the current file path.
|
void setPath(String path)
Resets the internal pointer to the last imported byte.
path - The file pathIllegalArgumentException - if the path is not null but blankvoid removePath()
ResultData readLines(LineReader.LineConsumer lineConsumer)
Each call to this methods tries to continue reading after the last imported byte from the previous call.
The internal pointer to the last imported byte can and will be reseted by setting or removing the path.
The auto-connect flag is set to false.
lineConsumer - The consumer which takes line by lineIllegalArgumentException - if the line consumer is nullIllegalArgumentException - if the path is null or emptyboolean exists(String pathToTest)
pathToTest - The file pathIllegalArgumentException - if the path is null or blankvoid close()
close in interface AutoCloseableclose in interface CloseableCopyright © 2019. All rights reserved.