public void writeFile(String filePath,String content){
  StringBuilder buf=new StringBuilder();
  String newContent=stripOffCR(content);
  String[] lines=newContent.split("\n");
  String cmd=null;
  for (  String line : lines) {
    if (cmd == null) {
      cmd=String.format(ImageServerDialogProperties.getString("cmd.writeFile"),line,filePath);
    }
 else {
      cmd=String.format(ImageServerDialogProperties.getString("cmd.writeFile.append"),line,filePath);
    }
    sendWaitFor(cmd,defaultTimeout,prompts,buf);
  }
}

public void writeFile ( String filePath , String content ) { StringBuilder buf = new StringBuilder ( ) ; String newContent = stripOffCR ( content ) ; String [ ] lines = newContent . split ( "\n" ) ; String cmd = null ; for ( String line : lines ) { if ( cmd == null ) { cmd = String . format ( ImageServerDialogProperties . getString ( "cmd.writeFile" ) , line , filePath ) ; } else { cmd = String . format ( ImageServerDialogProperties . getString ( "cmd.writeFile.append" ) , line , filePath ) ; } sendWaitFor ( cmd , defaultTimeout , prompts , buf ) ; } }
write file using echo command .
