Package org.apache.oodt.commons.io

Examples of org.apache.oodt.commons.io.LoggerOutputStream


      return callProgram(commandLine, stdOutStream, stdErrStream, null);
   }

   public static int callProgram(String commandLine, Logger logger, File workDir)
         throws IOException {
      LoggerOutputStream loggerInfoStream = null;
      LoggerOutputStream loggerSevereStream = null;
      try {
         return callProgram(
               commandLine,
               loggerInfoStream = new LoggerOutputStream(logger, Level.INFO),
               loggerSevereStream = new LoggerOutputStream(logger, Level.SEVERE),
               workDir);
      } catch (Exception e) {
         throw new IOException(e);
      } finally {
         try { loggerInfoStream.close(); } catch (Exception e) {}
         try { loggerSevereStream.close(); } catch (Exception e) {}
      }
   }
View Full Code Here


        try {
            progProcess = (workDir == null) ? Runtime.getRuntime().exec(
                    commandLine) : Runtime.getRuntime().exec(commandLine, null,
                    workDir);
            errorGobbler = new StreamGobbler(progProcess.getErrorStream(),
                    "ERROR", new LoggerOutputStream(logger, Level.SEVERE));
            outputGobbler = new StreamGobbler(progProcess.getInputStream(),
                    "OUTPUT", new LoggerOutputStream(logger, Level.INFO));
            errorGobbler.start();
            outputGobbler.start();
            returnVal = progProcess.waitFor();
            return returnVal;
        } catch (Exception e) {
View Full Code Here

TOP

Related Classes of org.apache.oodt.commons.io.LoggerOutputStream

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.