agave-systems/systems-core/src/main/java/org/iplantc/service/remote/local/CmdLineProcessHandler.java
/**
     * Log the output of the process to File if needed
     * @param processOutput either the out or err outputstream of the child process
     * @param outputFile    the file to write to
     * @throws IOException  if any of the file operations fail throw an IOException
     */
Log the output of the process to File if needed
@param processOutput either the out or err outputstream of the child process
@param outputFile    the file to write to
@throws IOException  if any of the file operations fail throw an IOException
Log the output of the process to File if needed @param processOutput either the out or err outputstream of the child process @param outputFile the file to write to @throws IOException if any of the file operations fail throw an IOException
public void logOutputToFile(CollectingLogOutputStream processOutput,File outputFile) 
    throws IOException
    {
        if(!outputFile.exists()){
            outputFile.createNewFile();
        }
        FileOutputStream fos = null;
        try {
	        fos = new FileOutputStream(outputFile);
	        fos.write(processOutput.getLinesAsString().getBytes());
        } 
        finally {
        	try { fos.close(); } catch (Exception e) {}
        }
    }
public void logOutputToFile ( CollectingLogOutputStream processOutput , File outputFile ) throws IOException { if ( ! outputFile . exists ( ) ) { outputFile . createNewFile ( ) ; } FileOutputStream fos = null ; try { fos = new FileOutputStream ( outputFile ) ; fos . write ( processOutput . getLinesAsString ( ) . getBytes ( ) ) ; } finally { try { fos . close ( ) ; } catch ( Exception e ) { } } }
Log the output of the process to File if needed
 @param processOutput either the out or err outputstream of the child process
 @param outputFile    the file to write to
 @throws IOException  if any of the file operations fail throw an IOException
Log the output of the process to File if needed @param processOutput either the out or err outputstream of the child process @param outputFile the file to write to @throws IOException if any of the file operations fail throw an IOException