}
StreamingCommand buildCommand(SourceLocation loc, String cmd, List<String> shipPaths, List<String> cachePaths,
List<HandleSpec> inputHandleSpecs, List<HandleSpec> outputHandleSpecs,
String logDir, Integer limit) throws RecognitionException {
StreamingCommand command = null;
try {
command = buildCommand( loc, cmd );
// Process ship paths
if( shipPaths != null ) {
if( shipPaths.size() == 0 ) {
command.setShipFiles( false );
} else {
for( String path : shipPaths )
command.addPathToShip( path );
}
}
// Process cache paths
if( cachePaths != null ) {
for( String path : cachePaths )
command.addPathToCache( path );
}
// Process input handle specs
if( inputHandleSpecs != null ) {
for( HandleSpec spec : inputHandleSpecs )
command.addHandleSpec( Handle.INPUT, spec );
}
// Process output handle specs
if( outputHandleSpecs != null ) {
for( HandleSpec spec : outputHandleSpecs )
command.addHandleSpec( Handle.OUTPUT, spec );
}
// error handling
if( logDir != null )
command.setLogDir( logDir );
if( limit != null )
command.setLogFilesLimit( limit );
} catch(IOException e) {
throw new PlanGenerationFailureException( intStream, loc, e );
}
return command;