|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectuk.ac.starlink.util.DataSource
uk.ac.starlink.util.ProcessDataSource
public class ProcessDataSource
DataSource that uses the standard output of a System process.
| Field Summary |
|---|
| Fields inherited from class uk.ac.starlink.util.DataSource |
|---|
DEFAULT_INTRO_LIMIT, MARK_WORKAROUND_PROPERTY |
| Constructor Summary | |
|---|---|
ProcessDataSource(java.lang.ProcessBuilder pbuilder)
Constructor. |
|
| Method Summary | |
|---|---|
static java.lang.ProcessBuilder |
createCommandLineProcessBuilder(java.lang.String cmdLine)
Utility method to create a process builder given a shell command line that generates output to standard output. |
protected java.io.InputStream |
getRawInputStream()
Provides a new InputStream for this data source. |
| Methods inherited from class uk.ac.starlink.util.DataSource |
|---|
close, forceCompression, getCompression, getHybridInputStream, getInputStream, getInputStream, getIntro, getIntroLimit, getLength, getMarkWorkaround, getName, getPosition, getRawLength, getSystemId, getURL, makeDataSource, makeDataSource, makeDataSource, setCompression, setIntroLimit, setMarkWorkaround, setName, setPosition, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ProcessDataSource(java.lang.ProcessBuilder pbuilder)
pbuilder - process builder| Method Detail |
|---|
protected java.io.InputStream getRawInputStream()
throws java.io.IOException
DataSource
getRawInputStream in class DataSourcejava.io.IOExceptionpublic static java.lang.ProcessBuilder createCommandLineProcessBuilder(java.lang.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 stdout
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||