/**
*author: Daniel Q. Oliveira
*date: 20/6/2001
*
*/

package com.linkway.util;

import java.io.*;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;

public class cSystem
{
    public static class runCommand
    {
        public static int run(String s)
        {
            try
            {
                ArrayList arraylist = new ArrayList();
                Process process = Runtime.getRuntime().exec(s);
                java.io.InputStream inputstream = process.getInputStream();
                BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(inputstream));
                String s1;
                while((s1 = bufferedreader.readLine()) != null) 
                    arraylist.add(s1);
                try
                {
                    process.waitFor();
                }
                catch(InterruptedException interruptedexception)
                {
                    System.err.println("Processo finalizado anormalmente");
                }
                bufferedreader.close();
                retorno = (String[])arraylist.toArray(new String[0]);
                return process.exitValue();
            }
            catch(IOException ioexception)
            {
                return 1;
            }
        }

        public static String retorno[];

        runCommand()
        {
        }
    }    
}
