Class Reader<R,A>
java.lang.Object
org.qubership.atp.environments.utils.Reader<R,A>
- All Implemented Interfaces:
AutoCloseable
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()static voidcloseQuietly(Closeable closeable) TODO Make javadoc documentation for this method.static <R> Reader<R, ?> create(InputStream is, Collector<? super String, ?, R> collector) booleanReads some chunk of data from theInputStream.flush()Reads all the remaining data from theInputStream.booleanReads some chunk of data from theInputStream.static <R> Optional<R> readInput(Supplier<Boolean> shouldStop, InputStream is, InputStream err, Collector<? super String, ?, R> collector) TODO Make javadoc documentation for this method.
-
Field Details
-
NO_RESPONSE_FROM_REMOTE_SERVER
- See Also:
-
-
Constructor Details
-
Reader
-
-
Method Details
-
create
-
readInput
public static <R> Optional<R> readInput(Supplier<Boolean> shouldStop, InputStream is, InputStream err, Collector<? super String, ?, throws IOException, TimeoutExceptionR> collector) TODO Make javadoc documentation for this method.- Parameters:
shouldStop- whenChannel.isClosed().is-Channel.getInputStream().err-ChannelExec.getErrStream().collector- result collector.- Returns:
- contents of
InputStream is. - Throws:
IOException- if an error occurred during reading the stream.IllegalArgumentException- if error stream contains an error.TimeoutException
-
closeQuietly
TODO Make javadoc documentation for this method. -
readAttempt
Reads some chunk of data from theInputStream.- Returns:
- true if there is something more to read.
- Throws:
IOException- if error occurred during reading the stream.
-
fileReadAttempt
Reads some chunk of data from theInputStream.- Returns:
- true if there is something more to read.
- Throws:
InterruptedIOException- if file is end.IOException
-
flush
Reads all the remaining data from theInputStream. Closes stream.- Returns:
- content what was read.
- Throws:
IOException- if error occurred during reading the stream.
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-