public class ProcessDataSource extends DataSource
DEFAULT_INTRO_LIMIT, MARK_WORKAROUND_PROPERTY
Constructor and Description |
---|
ProcessDataSource(ProcessBuilder pbuilder)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static ProcessBuilder |
createCommandLineProcessBuilder(String cmdLine)
Utility method to create a process builder given a shell command line
that generates output to standard output.
|
protected InputStream |
getRawInputStream()
Provides a new InputStream for this data source.
|
close, forceCompression, getCompression, getHybridInputStream, getInputStream, getInputStream, getIntro, getIntroLimit, getLength, getMarkWorkaround, getName, getPosition, getRawLength, getSystemId, getURL, makeDataSource, makeDataSource, makeDataSource, setCompression, setIntroLimit, setMarkWorkaround, setName, setPosition, toString
public ProcessDataSource(ProcessBuilder pbuilder)
pbuilder
- process builderprotected InputStream getRawInputStream() throws IOException
DataSource
getRawInputStream
in class DataSource
IOException
public static ProcessBuilder createCommandLineProcessBuilder(String cmdLine)
This method simply sets up a ProcessBuilder to execute a process with the argv { "sh", "-c", cmdLine }. I haven't tested this exhaustively, but I'd expect it to work on un*x-like systems. I've got no idea if there's any chance of getting something like this to work on MS Windows, or even if such a thing would be any use.
cmdLine
- shell command that generates output to stdoutCopyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.