public interface To
Modifier and Type | Method and Description |
---|---|
void |
toDevNull()
Executes the composite command and does not write the result anywhere.
|
int |
toExitValue()
Executes the composite command returns its exit value, 0 if the command
completes successfully and another command specific error value different
from zero if the command throws an
ExitValueException . |
void |
toFile(File file)
Executes the composite command and writes the result to the given file.
|
void |
toFile(String file)
Executes the composite command and writes the result to the given file.
|
List<Line> |
toLineList()
Executes the composite command and returns the result as a list
containing the output lines.
|
Stream<Line> |
toLineStream()
Executes the composite command and returns the result as a stream
containing the output lines.
|
void |
toOutput(Output output)
Executes the composite command and writes the result to the given output.
|
void |
toOutputStream(OutputStream stream)
Executes the composite command and writes the result to the given stream.
|
void |
toStdOut()
Executes the composite command and writes the result to the standard
output.
|
List<String> |
toStringList()
Executes the composite command and returns the result as a list
containing the output lines without line ending.
|
String |
toStringResult()
Executes the composite command and returns the result as string.
|
Stream<String> |
toStringStream()
Executes the composite command and returns the result as a stream
containing the output lines without line endings.
|
void |
toWriter(Writer writer)
Executes the composite command and writes the result using the given
writer.
|
void toStdOut()
String toStringResult()
To return a representation of the command with its arguments without
executing the command, toString()
can be used
instead.
List<Line> toLineList()
List<String> toStringList()
Stream<Line> toLineStream()
Stream<String> toStringStream()
void toFile(String file)
file
- the target output filevoid toDevNull()
void toFile(File file)
file
- the target output filevoid toOutputStream(OutputStream stream)
stream
- the target output streamvoid toWriter(Writer writer)
writer
- the writer used to write the outputvoid toOutput(Output output)
int toExitValue()
ExitValueException
.Copyright © 2024. All rights reserved.