com.anrisoftware.globalpom.exec.api.CommandInput Maven / Gradle / Ivy
/*
* Copyright 2014-2015 Erwin Müller
*
* This file is part of globalpomutils-exec.
*
* globalpomutils-exec is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* globalpomutils-exec is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with globalpomutils-exec. If not, see .
*/
package com.anrisoftware.globalpom.exec.api;
import java.io.OutputStream;
import java.util.concurrent.Callable;
/**
* Reads the standard output of the executed command.
*
* @author Erwin Mueller, [email protected]
* @since 1.11
*/
public interface CommandInput extends Callable {
/**
* Sets the stream that is connected to the standard input of the executed
* command.
*
* @param stream
* the {@link OutputStream}.
*/
void setOutput(OutputStream stream);
/**
* Clones the standard input writer. The cloned writer have the same
* connected output stream.
*
* @return the cloned {@link CommandInput}.
*/
CommandInput clone();
/**
* Writes to the standard input to the connected stream.
*/
@Override
CommandInput call() throws Exception;
}