tassl.application.utils
Class CommonUtils

java.lang.Object
  extended by tassl.application.utils.CommonUtils

public class CommonUtils
extends java.lang.Object


Constructor Summary
CommonUtils()
           
 
Method Summary
static void closeInOut(java.io.DataInputStream in, java.io.DataOutputStream out)
           
static int execute(java.lang.String command)
          Execute a system command and returns output status.
static java.lang.String[] execute(java.lang.String command, boolean background)
          Executes a system command
static java.io.DataOutputStream getOutput(java.lang.String address, int port)
          Get a socket connection with address and port.
static java.lang.Object[] getOutputInput(java.lang.String address, int port)
          Get a socket connection with address and port.
static java.lang.Object[] getOutputInput(java.lang.String address, int port, boolean skiplogs)
          Get a socket connection with address and port.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommonUtils

public CommonUtils()
Method Detail

getOutput

public static java.io.DataOutputStream getOutput(java.lang.String address,
                                                 int port)
Get a socket connection with address and port.

Parameters:
address -
port -
Returns:
object[DataOutputStream]

getOutputInput

public static java.lang.Object[] getOutputInput(java.lang.String address,
                                                int port)
Get a socket connection with address and port.

Parameters:
address -
port -
Returns:
object[DataInputStream,DataOutputStream]

getOutputInput

public static java.lang.Object[] getOutputInput(java.lang.String address,
                                                int port,
                                                boolean skiplogs)
Get a socket connection with address and port.

Parameters:
address -
port -
skiplogs -
Returns:
object[DataInputStream,DataOutputStream]

closeInOut

public static void closeInOut(java.io.DataInputStream in,
                              java.io.DataOutputStream out)

execute

public static int execute(java.lang.String command)
Execute a system command and returns output status. It will log in info level the stdout and stderr

Parameters:
command -
Returns:
output status

execute

public static java.lang.String[] execute(java.lang.String command,
                                         boolean background)
Executes a system command

Parameters:
command -
background - Whether it waits for the command to finish or not
Returns:
String[output status, stdout, stderr]