Package me.mabra.hellonzb.util

Examples of me.mabra.hellonzb.util.StreamGobbler


   
    // execute command
    String [] cmdArray = cmd.toArray(new String[] {});
    Runtime rt = Runtime.getRuntime();
    Process proc = rt.exec(cmdArray, null, destination);
    StreamGobbler errGobbler = new StreamGobbler(logger, proc.getErrorStream(), "Unrar (Error)");
    StreamGobbler outGobbler = new StreamGobbler(logger, proc.getInputStream(), "Unrar");
   
    // fetch command's STDOUT and STDERR
    errGobbler.start();
    outGobbler.start();
   
    // wait until program has finished
    int exitVal = proc.waitFor();
    logger.msg("Unrar command exit value: " + exitVal, MyLogger.SEV_INFO);

    // get RAR archive part file names
    for(String line : outGobbler.getLines())
    {
      String l = line.trim();
      if(l.startsWith("Extracting from "))
        rarPartFiles.add(l.substring(16));
    }
View Full Code Here

TOP

Related Classes of me.mabra.hellonzb.util.StreamGobbler

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.