public String readFile(String filePath){
  StringBuilder buf=new StringBuilder();
  String command=String.format(ImageServerDialogProperties.getString("cmd.readFile"),filePath);
  sendWaitFor(command,defaultTimeout,prompts,buf);
  log.debug(buf.toString());
  int from=command.length() + 1;
  int to=buf.indexOf(PROMPT) - 2;
  if (to <= from) {
    return "";
  }
  return buf.substring(from,to);
}

public String readFile ( String filePath ) { StringBuilder buf = new StringBuilder ( ) ; String command = String . format ( ImageServerDialogProperties . getString ( "cmd.readFile" ) , filePath ) ; sendWaitFor ( command , defaultTimeout , prompts , buf ) ; log . debug ( buf . toString ( ) ) ; int from = command . length ( ) + 1 ; int to = buf . indexOf ( PROMPT ) - 2 ; if ( to <= from ) { return "" ; } return buf . substring ( from , to ) ; }
returns file content using the ' cat ' command .
